From 181aa50ce9cfac09db168559dbe35f1684209398 Mon Sep 17 00:00:00 2001 From: Ankur Banerjee Date: Wed, 25 Mar 2026 23:41:24 +0100 Subject: [PATCH 1/3] chore: add Claude Code configuration with CLAUDE.md, hooks, skills, and agents Set up Claude Code project configuration including CLAUDE.md with architecture docs, auto-format and file protection hooks, a db-migrate skill for Drizzle workflow, and an api-documenter subagent. Co-Authored-By: Claude Opus 4.6 --- .claude/agents/api-documenter.md | 22 ++++++++++++++++ .claude/settings.json | 16 ++++++++++++ .claude/skills/db-migrate/SKILL.md | 17 ++++++++++++ CLAUDE.md | 42 ++++++++++++++++++++++++++++++ 4 files changed, 97 insertions(+) create mode 100644 .claude/agents/api-documenter.md create mode 100644 .claude/settings.json create mode 100644 .claude/skills/db-migrate/SKILL.md create mode 100644 CLAUDE.md diff --git a/.claude/agents/api-documenter.md b/.claude/agents/api-documenter.md new file mode 100644 index 0000000..4e332e5 --- /dev/null +++ b/.claude/agents/api-documenter.md @@ -0,0 +1,22 @@ +--- +name: api-documenter +description: Generate REST API documentation by tracing route handlers +--- + +# API Documenter + +Analyze the API routes and handlers to generate endpoint documentation. + +## Instructions + +1. Read `src/index.ts` to identify all registered routes +2. Read each handler in `src/handlers/` to understand request parameters and response shapes +3. Read helpers in `src/helpers/` for business logic details where relevant +4. Read types in `src/types/` for data structures +5. For each endpoint, document: + - HTTP method and path + - URL parameters (if any) + - Query parameters (if any) + - Response format and shape + - Example response values +6. Output the documentation in a clear format diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 0000000..2a33995 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,16 @@ +{ + "hooks": { + "PreToolUse": [ + { + "matcher": "Edit|Write", + "command": "echo \"$CLAUDE_FILE_PATH\" | grep -qE '(package-lock\\.json|src/database/migrations/)' && echo 'BLOCK: Do not edit generated files (lock files, migrations)' && exit 1 || exit 0" + } + ], + "PostToolUse": [ + { + "matcher": "Edit|Write", + "command": "npx prettier --write \"$CLAUDE_FILE_PATH\" 2>/dev/null || true" + } + ] + } +} diff --git a/.claude/skills/db-migrate/SKILL.md b/.claude/skills/db-migrate/SKILL.md new file mode 100644 index 0000000..bc5bf94 --- /dev/null +++ b/.claude/skills/db-migrate/SKILL.md @@ -0,0 +1,17 @@ +--- +name: db-migrate +description: Generate and review Drizzle ORM database migrations after schema changes +disable-model-invocation: true +--- + +# Database Migration Workflow + +Run the full Drizzle ORM migration workflow after schema changes. + +## Steps + +1. Review changes in `src/database/schema.ts` to understand what changed +2. Run `npm run db:generate` to generate a new migration SQL file +3. Read the newly generated SQL file in `src/database/migrations/` and review it for correctness +4. Report the migration SQL to the user for confirmation before proceeding +5. Only run `npm run db:migrate` if the user explicitly confirms diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..3c28dbd --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,42 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Commands + +- `npm run dev` — Local dev server (staging env, port 8787) +- `npm run build` — Dry-run deploy to generate dist +- `npm run format` — Prettier format all files +- `npm run lint` — ESLint check (config at `.github/linters/eslint.config.mjs`) +- `npm run lint:fix` — ESLint autofix +- `npm run db:generate` — Generate Drizzle migration from schema changes +- `npm run db:migrate` — Push schema to database +- `npm run db:seed` — Seed reference data (denoms, operation types) + +## Architecture + +Cloudflare Worker for the cheqd blockchain network. Two entry points in `src/index.ts`: + +1. **`fetch`** — HTTP API via itty-router. Serves supply data, account balances, and identity analytics. +2. **`scheduled`** — Hourly cron trigger that updates cached circulating supply balances and syncs identity data from BigDipper GraphQL into PostgreSQL. + +### Data flow + +- **Supply/balance endpoints** — Handlers in `src/handlers/` call external APIs (`src/api/`) via helpers. The Cosmos SDK REST API (`REST_API`) provides account data; BigDipper GraphQL (`GRAPHQL_API`) provides total supply and identity transactions. +- **Circulating supply** — Watchlist addresses are stored in Cloudflare KV, grouped by `group_N:` prefix. The hourly cron processes one group per hour (24 groups = 24 hours), updating each address's cached balance breakdown. The circulating supply endpoint subtracts all watchlist balances from total supply. +- **Identity analytics sync** — `SyncService` in `src/helpers/identity.ts` incrementally syncs DID and resource transactions from BigDipper into PostgreSQL (via Hyperdrive). It tracks the last block height to avoid re-processing, with composite key deduplication (txHash + operationType + entityId). +- **Analytics queries** — `src/handlers/analytics.ts` queries the PostgreSQL tables with filtering (date range, operation type, denom, feePayer, didId, success) and pagination. Supports CSV export. + +### Database + +PostgreSQL accessed through Cloudflare Hyperdrive. Schema in `src/database/schema.ts` mirrors tables for mainnet and testnet (e.g., `did_mainnet`/`did_testnet`, `resource_mainnet`/`resource_testnet`). Each network has its own enum types, denom lookup table, and operation types lookup table. The `TABLES` map in `src/helpers/identity.ts` selects the correct table set by network. + +### Environment + +All env vars and bindings are typed in `src/worker-types.d.ts` as the global `Env` interface. Key bindings: `HYPERDRIVE` (PostgreSQL connection pooler), `CIRCULATING_SUPPLY_WATCHLIST` (KV namespace). Secrets (`WEBHOOK_URL`) are set via `wrangler secret put`, not in config files. + +## Conventions + +- Prettier: tabs, single quotes, 120 char width, trailing commas (es5) +- Conventional commits — semantic-release automates versioning and changelogs +- All token amounts are converted from lowest denom (`ncheq`) to main denom (`CHEQ`) using `TOKEN_EXPONENT` (10^9) From 6f2140e7f7af320dda828642a90ebb254797ddc1 Mon Sep 17 00:00:00 2001 From: Ankur Banerjee Date: Wed, 25 Mar 2026 23:55:58 +0100 Subject: [PATCH 2/3] fix: correct Claude Code hooks schema to use nested hooks array with jq stdin parsing The hooks were using an invalid flat command format and nonexistent $CLAUDE_FILE_PATH env var. Fixed to use the required nested hooks array structure and parse file_path from stdin JSON via jq. Co-Authored-By: Claude Opus 4.6 --- .claude/settings.json | 38 +- .../migrations/meta/0004_snapshot.json | 1666 ++++++++--------- src/database/migrations/meta/_journal.json | 80 +- 3 files changed, 875 insertions(+), 909 deletions(-) diff --git a/.claude/settings.json b/.claude/settings.json index 2a33995..a82736f 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -1,16 +1,26 @@ { - "hooks": { - "PreToolUse": [ - { - "matcher": "Edit|Write", - "command": "echo \"$CLAUDE_FILE_PATH\" | grep -qE '(package-lock\\.json|src/database/migrations/)' && echo 'BLOCK: Do not edit generated files (lock files, migrations)' && exit 1 || exit 0" - } - ], - "PostToolUse": [ - { - "matcher": "Edit|Write", - "command": "npx prettier --write \"$CLAUDE_FILE_PATH\" 2>/dev/null || true" - } - ] - } + "hooks": { + "PreToolUse": [ + { + "matcher": "Edit|Write", + "hooks": [ + { + "type": "command", + "command": "FILE=$(jq -r '.tool_input.file_path') && echo \"$FILE\" | grep -qE '(package-lock\\.json|src/database/migrations/)' && echo 'BLOCK: Do not edit generated files (lock files, migrations)' && exit 1 || exit 0" + } + ] + } + ], + "PostToolUse": [ + { + "matcher": "Edit|Write", + "hooks": [ + { + "type": "command", + "command": "jq -r '.tool_input.file_path' | xargs npx prettier --write 2>/dev/null || true" + } + ] + } + ] + } } diff --git a/src/database/migrations/meta/0004_snapshot.json b/src/database/migrations/meta/0004_snapshot.json index 2df3407..0f00f8b 100644 --- a/src/database/migrations/meta/0004_snapshot.json +++ b/src/database/migrations/meta/0004_snapshot.json @@ -1,856 +1,812 @@ { - "id": "29e2517a-42dd-435c-98ea-637d9db432c4", - "prevId": "44c374c8-9d41-4141-a79f-f0743a3d863b", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.denom_mainnet": { - "name": "denom_mainnet", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "ledger_denom": { - "name": "ledger_denom", - "type": "denoms_enum_mainnet", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'ncheq'" - }, - "friendly_denom": { - "name": "friendly_denom", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "'CHEQ'" - }, - "exponent": { - "name": "exponent", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "denom_mainnet_ledger_denom_unique": { - "name": "denom_mainnet_ledger_denom_unique", - "nullsNotDistinct": false, - "columns": [ - "ledger_denom" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.denom_testnet": { - "name": "denom_testnet", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "ledger_denom": { - "name": "ledger_denom", - "type": "denoms_enum_testnet", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'ncheq'" - }, - "friendly_denom": { - "name": "friendly_denom", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "'ncheq'" - }, - "exponent": { - "name": "exponent", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "denom_testnet_ledger_denom_unique": { - "name": "denom_testnet_ledger_denom_unique", - "nullsNotDistinct": false, - "columns": [ - "ledger_denom" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.did_mainnet": { - "name": "did_mainnet", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "did_id": { - "name": "did_id", - "type": "varchar(54)", - "primaryKey": false, - "notNull": true - }, - "operation_type": { - "name": "operation_type", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "fee_payer": { - "name": "fee_payer", - "type": "varchar(44)", - "primaryKey": false, - "notNull": true - }, - "amount": { - "name": "amount", - "type": "numeric", - "primaryKey": false, - "notNull": true - }, - "denom": { - "name": "denom", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "block_height": { - "name": "block_height", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "transaction_hash": { - "name": "transaction_hash", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "success": { - "name": "success", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_did_mainnet_tx_op_did": { - "name": "idx_did_mainnet_tx_op_did", - "columns": [ - { - "expression": "transaction_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "operation_type", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "did_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "did_mainnet_operation_type_operation_types_mainnet_id_fk": { - "name": "did_mainnet_operation_type_operation_types_mainnet_id_fk", - "tableFrom": "did_mainnet", - "tableTo": "operation_types_mainnet", - "columnsFrom": [ - "operation_type" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "did_mainnet_denom_denom_mainnet_id_fk": { - "name": "did_mainnet_denom_denom_mainnet_id_fk", - "tableFrom": "did_mainnet", - "tableTo": "denom_mainnet", - "columnsFrom": [ - "denom" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.did_testnet": { - "name": "did_testnet", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "did_id": { - "name": "did_id", - "type": "varchar(54)", - "primaryKey": false, - "notNull": true - }, - "operation_type": { - "name": "operation_type", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "fee_payer": { - "name": "fee_payer", - "type": "varchar(44)", - "primaryKey": false, - "notNull": true - }, - "amount": { - "name": "amount", - "type": "numeric", - "primaryKey": false, - "notNull": true - }, - "denom": { - "name": "denom", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "block_height": { - "name": "block_height", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "transaction_hash": { - "name": "transaction_hash", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "success": { - "name": "success", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_did_testnet_tx_op_did": { - "name": "idx_did_testnet_tx_op_did", - "columns": [ - { - "expression": "transaction_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "operation_type", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "did_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "did_testnet_operation_type_operation_types_testnet_id_fk": { - "name": "did_testnet_operation_type_operation_types_testnet_id_fk", - "tableFrom": "did_testnet", - "tableTo": "operation_types_testnet", - "columnsFrom": [ - "operation_type" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "did_testnet_denom_denom_testnet_id_fk": { - "name": "did_testnet_denom_denom_testnet_id_fk", - "tableFrom": "did_testnet", - "tableTo": "denom_testnet", - "columnsFrom": [ - "denom" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.operation_types_mainnet": { - "name": "operation_types_mainnet", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "ledger_operation_type": { - "name": "ledger_operation_type", - "type": "operation_type_enum_mainnet", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "friendly_operation_type": { - "name": "friendly_operation_type", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "'friendly'" - }, - "description": { - "name": "description", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "operation_types_mainnet_ledger_operation_type_unique": { - "name": "operation_types_mainnet_ledger_operation_type_unique", - "nullsNotDistinct": false, - "columns": [ - "ledger_operation_type" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.operation_types_testnet": { - "name": "operation_types_testnet", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "ledger_operation_type": { - "name": "ledger_operation_type", - "type": "operation_type_enum_testnet", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "friendly_operation_type": { - "name": "friendly_operation_type", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "'friendly'" - }, - "description": { - "name": "description", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "operation_types_testnet_ledger_operation_type_unique": { - "name": "operation_types_testnet_ledger_operation_type_unique", - "nullsNotDistinct": false, - "columns": [ - "ledger_operation_type" - ] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.resource_mainnet": { - "name": "resource_mainnet", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "resource_id": { - "name": "resource_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "resource_type": { - "name": "resource_type", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "resource_name": { - "name": "resource_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "operation_type": { - "name": "operation_type", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "did_id": { - "name": "did_id", - "type": "varchar(54)", - "primaryKey": false, - "notNull": false - }, - "fee_payer": { - "name": "fee_payer", - "type": "varchar(44)", - "primaryKey": false, - "notNull": true - }, - "amount": { - "name": "amount", - "type": "numeric", - "primaryKey": false, - "notNull": true - }, - "denom": { - "name": "denom", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "block_height": { - "name": "block_height", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "transaction_hash": { - "name": "transaction_hash", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "success": { - "name": "success", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_resource_mainnet_tx_op_resource": { - "name": "idx_resource_mainnet_tx_op_resource", - "columns": [ - { - "expression": "transaction_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "operation_type", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "resource_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "resource_mainnet_operation_type_operation_types_mainnet_id_fk": { - "name": "resource_mainnet_operation_type_operation_types_mainnet_id_fk", - "tableFrom": "resource_mainnet", - "tableTo": "operation_types_mainnet", - "columnsFrom": [ - "operation_type" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "resource_mainnet_denom_denom_mainnet_id_fk": { - "name": "resource_mainnet_denom_denom_mainnet_id_fk", - "tableFrom": "resource_mainnet", - "tableTo": "denom_mainnet", - "columnsFrom": [ - "denom" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.resource_testnet": { - "name": "resource_testnet", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "resource_id": { - "name": "resource_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "resource_type": { - "name": "resource_type", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "resource_name": { - "name": "resource_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "operation_type": { - "name": "operation_type", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "did_id": { - "name": "did_id", - "type": "varchar(54)", - "primaryKey": false, - "notNull": false - }, - "fee_payer": { - "name": "fee_payer", - "type": "varchar(44)", - "primaryKey": false, - "notNull": true - }, - "amount": { - "name": "amount", - "type": "numeric", - "primaryKey": false, - "notNull": true - }, - "denom": { - "name": "denom", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "block_height": { - "name": "block_height", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "transaction_hash": { - "name": "transaction_hash", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "success": { - "name": "success", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_resource_testnet_tx_op_resource": { - "name": "idx_resource_testnet_tx_op_resource", - "columns": [ - { - "expression": "transaction_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "operation_type", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "resource_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "resource_testnet_operation_type_operation_types_testnet_id_fk": { - "name": "resource_testnet_operation_type_operation_types_testnet_id_fk", - "tableFrom": "resource_testnet", - "tableTo": "operation_types_testnet", - "columnsFrom": [ - "operation_type" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - }, - "resource_testnet_denom_denom_testnet_id_fk": { - "name": "resource_testnet_denom_denom_testnet_id_fk", - "tableFrom": "resource_testnet", - "tableTo": "denom_testnet", - "columnsFrom": [ - "denom" - ], - "columnsTo": [ - "id" - ], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.denoms_enum_mainnet": { - "name": "denoms_enum_mainnet", - "schema": "public", - "values": [ - "ncheq" - ] - }, - "public.denoms_enum_testnet": { - "name": "denoms_enum_testnet", - "schema": "public", - "values": [ - "ncheq" - ] - }, - "public.operation_type_enum_mainnet": { - "name": "operation_type_enum_mainnet", - "schema": "public", - "values": [ - "cheqd.did.v2.MsgCreateDidDoc", - "cheqd.did.v2.MsgUpdateDidDoc", - "cheqd.did.v2.MsgDeactivateDidDoc", - "cheqd.resource.v2.MsgCreateResource" - ] - }, - "public.operation_type_enum_testnet": { - "name": "operation_type_enum_testnet", - "schema": "public", - "values": [ - "cheqd.did.v2.MsgCreateDidDoc", - "cheqd.did.v2.MsgUpdateDidDoc", - "cheqd.did.v2.MsgDeactivateDidDoc", - "cheqd.resource.v2.MsgCreateResource" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file + "id": "29e2517a-42dd-435c-98ea-637d9db432c4", + "prevId": "44c374c8-9d41-4141-a79f-f0743a3d863b", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.denom_mainnet": { + "name": "denom_mainnet", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "ledger_denom": { + "name": "ledger_denom", + "type": "denoms_enum_mainnet", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'ncheq'" + }, + "friendly_denom": { + "name": "friendly_denom", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'CHEQ'" + }, + "exponent": { + "name": "exponent", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "denom_mainnet_ledger_denom_unique": { + "name": "denom_mainnet_ledger_denom_unique", + "nullsNotDistinct": false, + "columns": ["ledger_denom"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.denom_testnet": { + "name": "denom_testnet", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "ledger_denom": { + "name": "ledger_denom", + "type": "denoms_enum_testnet", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'ncheq'" + }, + "friendly_denom": { + "name": "friendly_denom", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'ncheq'" + }, + "exponent": { + "name": "exponent", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "denom_testnet_ledger_denom_unique": { + "name": "denom_testnet_ledger_denom_unique", + "nullsNotDistinct": false, + "columns": ["ledger_denom"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.did_mainnet": { + "name": "did_mainnet", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "did_id": { + "name": "did_id", + "type": "varchar(54)", + "primaryKey": false, + "notNull": true + }, + "operation_type": { + "name": "operation_type", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "fee_payer": { + "name": "fee_payer", + "type": "varchar(44)", + "primaryKey": false, + "notNull": true + }, + "amount": { + "name": "amount", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "denom": { + "name": "denom", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "block_height": { + "name": "block_height", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "transaction_hash": { + "name": "transaction_hash", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "success": { + "name": "success", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "idx_did_mainnet_tx_op_did": { + "name": "idx_did_mainnet_tx_op_did", + "columns": [ + { + "expression": "transaction_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "operation_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "did_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "did_mainnet_operation_type_operation_types_mainnet_id_fk": { + "name": "did_mainnet_operation_type_operation_types_mainnet_id_fk", + "tableFrom": "did_mainnet", + "tableTo": "operation_types_mainnet", + "columnsFrom": ["operation_type"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "did_mainnet_denom_denom_mainnet_id_fk": { + "name": "did_mainnet_denom_denom_mainnet_id_fk", + "tableFrom": "did_mainnet", + "tableTo": "denom_mainnet", + "columnsFrom": ["denom"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.did_testnet": { + "name": "did_testnet", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "did_id": { + "name": "did_id", + "type": "varchar(54)", + "primaryKey": false, + "notNull": true + }, + "operation_type": { + "name": "operation_type", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "fee_payer": { + "name": "fee_payer", + "type": "varchar(44)", + "primaryKey": false, + "notNull": true + }, + "amount": { + "name": "amount", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "denom": { + "name": "denom", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "block_height": { + "name": "block_height", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "transaction_hash": { + "name": "transaction_hash", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "success": { + "name": "success", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "idx_did_testnet_tx_op_did": { + "name": "idx_did_testnet_tx_op_did", + "columns": [ + { + "expression": "transaction_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "operation_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "did_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "did_testnet_operation_type_operation_types_testnet_id_fk": { + "name": "did_testnet_operation_type_operation_types_testnet_id_fk", + "tableFrom": "did_testnet", + "tableTo": "operation_types_testnet", + "columnsFrom": ["operation_type"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "did_testnet_denom_denom_testnet_id_fk": { + "name": "did_testnet_denom_denom_testnet_id_fk", + "tableFrom": "did_testnet", + "tableTo": "denom_testnet", + "columnsFrom": ["denom"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.operation_types_mainnet": { + "name": "operation_types_mainnet", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "ledger_operation_type": { + "name": "ledger_operation_type", + "type": "operation_type_enum_mainnet", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "friendly_operation_type": { + "name": "friendly_operation_type", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'friendly'" + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "operation_types_mainnet_ledger_operation_type_unique": { + "name": "operation_types_mainnet_ledger_operation_type_unique", + "nullsNotDistinct": false, + "columns": ["ledger_operation_type"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.operation_types_testnet": { + "name": "operation_types_testnet", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "ledger_operation_type": { + "name": "ledger_operation_type", + "type": "operation_type_enum_testnet", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "friendly_operation_type": { + "name": "friendly_operation_type", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'friendly'" + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "operation_types_testnet_ledger_operation_type_unique": { + "name": "operation_types_testnet_ledger_operation_type_unique", + "nullsNotDistinct": false, + "columns": ["ledger_operation_type"] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resource_mainnet": { + "name": "resource_mainnet", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "resource_id": { + "name": "resource_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "resource_type": { + "name": "resource_type", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "resource_name": { + "name": "resource_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "operation_type": { + "name": "operation_type", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "did_id": { + "name": "did_id", + "type": "varchar(54)", + "primaryKey": false, + "notNull": false + }, + "fee_payer": { + "name": "fee_payer", + "type": "varchar(44)", + "primaryKey": false, + "notNull": true + }, + "amount": { + "name": "amount", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "denom": { + "name": "denom", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "block_height": { + "name": "block_height", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "transaction_hash": { + "name": "transaction_hash", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "success": { + "name": "success", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "idx_resource_mainnet_tx_op_resource": { + "name": "idx_resource_mainnet_tx_op_resource", + "columns": [ + { + "expression": "transaction_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "operation_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "resource_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "resource_mainnet_operation_type_operation_types_mainnet_id_fk": { + "name": "resource_mainnet_operation_type_operation_types_mainnet_id_fk", + "tableFrom": "resource_mainnet", + "tableTo": "operation_types_mainnet", + "columnsFrom": ["operation_type"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "resource_mainnet_denom_denom_mainnet_id_fk": { + "name": "resource_mainnet_denom_denom_mainnet_id_fk", + "tableFrom": "resource_mainnet", + "tableTo": "denom_mainnet", + "columnsFrom": ["denom"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resource_testnet": { + "name": "resource_testnet", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "resource_id": { + "name": "resource_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "resource_type": { + "name": "resource_type", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "resource_name": { + "name": "resource_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "operation_type": { + "name": "operation_type", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "did_id": { + "name": "did_id", + "type": "varchar(54)", + "primaryKey": false, + "notNull": false + }, + "fee_payer": { + "name": "fee_payer", + "type": "varchar(44)", + "primaryKey": false, + "notNull": true + }, + "amount": { + "name": "amount", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "denom": { + "name": "denom", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "block_height": { + "name": "block_height", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "transaction_hash": { + "name": "transaction_hash", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "success": { + "name": "success", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "idx_resource_testnet_tx_op_resource": { + "name": "idx_resource_testnet_tx_op_resource", + "columns": [ + { + "expression": "transaction_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "operation_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "resource_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "resource_testnet_operation_type_operation_types_testnet_id_fk": { + "name": "resource_testnet_operation_type_operation_types_testnet_id_fk", + "tableFrom": "resource_testnet", + "tableTo": "operation_types_testnet", + "columnsFrom": ["operation_type"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + }, + "resource_testnet_denom_denom_testnet_id_fk": { + "name": "resource_testnet_denom_denom_testnet_id_fk", + "tableFrom": "resource_testnet", + "tableTo": "denom_testnet", + "columnsFrom": ["denom"], + "columnsTo": ["id"], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.denoms_enum_mainnet": { + "name": "denoms_enum_mainnet", + "schema": "public", + "values": ["ncheq"] + }, + "public.denoms_enum_testnet": { + "name": "denoms_enum_testnet", + "schema": "public", + "values": ["ncheq"] + }, + "public.operation_type_enum_mainnet": { + "name": "operation_type_enum_mainnet", + "schema": "public", + "values": [ + "cheqd.did.v2.MsgCreateDidDoc", + "cheqd.did.v2.MsgUpdateDidDoc", + "cheqd.did.v2.MsgDeactivateDidDoc", + "cheqd.resource.v2.MsgCreateResource" + ] + }, + "public.operation_type_enum_testnet": { + "name": "operation_type_enum_testnet", + "schema": "public", + "values": [ + "cheqd.did.v2.MsgCreateDidDoc", + "cheqd.did.v2.MsgUpdateDidDoc", + "cheqd.did.v2.MsgDeactivateDidDoc", + "cheqd.resource.v2.MsgCreateResource" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} diff --git a/src/database/migrations/meta/_journal.json b/src/database/migrations/meta/_journal.json index c18b2dd..dd66051 100644 --- a/src/database/migrations/meta/_journal.json +++ b/src/database/migrations/meta/_journal.json @@ -1,41 +1,41 @@ { - "version": "7", - "dialect": "postgresql", - "entries": [ - { - "idx": 0, - "version": "7", - "when": 1741197616979, - "tag": "0000_salty_machine_man", - "breakpoints": true - }, - { - "idx": 1, - "version": "7", - "when": 1741392062249, - "tag": "0001_hard_jane_foster", - "breakpoints": true - }, - { - "idx": 2, - "version": "7", - "when": 1741705797047, - "tag": "0002_dazzling_colossus", - "breakpoints": true - }, - { - "idx": 3, - "version": "7", - "when": 1741774436871, - "tag": "0003_overjoyed_elektra", - "breakpoints": true - }, - { - "idx": 4, - "version": "7", - "when": 1768983905645, - "tag": "0004_sloppy_paladin", - "breakpoints": true - } - ] -} \ No newline at end of file + "version": "7", + "dialect": "postgresql", + "entries": [ + { + "idx": 0, + "version": "7", + "when": 1741197616979, + "tag": "0000_salty_machine_man", + "breakpoints": true + }, + { + "idx": 1, + "version": "7", + "when": 1741392062249, + "tag": "0001_hard_jane_foster", + "breakpoints": true + }, + { + "idx": 2, + "version": "7", + "when": 1741705797047, + "tag": "0002_dazzling_colossus", + "breakpoints": true + }, + { + "idx": 3, + "version": "7", + "when": 1741774436871, + "tag": "0003_overjoyed_elektra", + "breakpoints": true + }, + { + "idx": 4, + "version": "7", + "when": 1768983905645, + "tag": "0004_sloppy_paladin", + "breakpoints": true + } + ] +} From b059f0735e0712f6b459c98474420ff9c6e85bb2 Mon Sep 17 00:00:00 2001 From: Ankur Banerjee Date: Wed, 25 Mar 2026 23:56:52 +0100 Subject: [PATCH 3/3] revert: remove unrelated Drizzle migration snapshot changes Co-Authored-By: Claude Opus 4.6 --- .../migrations/meta/0004_snapshot.json | 1666 +++++++++-------- src/database/migrations/meta/_journal.json | 80 +- 2 files changed, 895 insertions(+), 851 deletions(-) diff --git a/src/database/migrations/meta/0004_snapshot.json b/src/database/migrations/meta/0004_snapshot.json index 0f00f8b..2df3407 100644 --- a/src/database/migrations/meta/0004_snapshot.json +++ b/src/database/migrations/meta/0004_snapshot.json @@ -1,812 +1,856 @@ { - "id": "29e2517a-42dd-435c-98ea-637d9db432c4", - "prevId": "44c374c8-9d41-4141-a79f-f0743a3d863b", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.denom_mainnet": { - "name": "denom_mainnet", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "ledger_denom": { - "name": "ledger_denom", - "type": "denoms_enum_mainnet", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'ncheq'" - }, - "friendly_denom": { - "name": "friendly_denom", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "'CHEQ'" - }, - "exponent": { - "name": "exponent", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "denom_mainnet_ledger_denom_unique": { - "name": "denom_mainnet_ledger_denom_unique", - "nullsNotDistinct": false, - "columns": ["ledger_denom"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.denom_testnet": { - "name": "denom_testnet", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "ledger_denom": { - "name": "ledger_denom", - "type": "denoms_enum_testnet", - "typeSchema": "public", - "primaryKey": false, - "notNull": true, - "default": "'ncheq'" - }, - "friendly_denom": { - "name": "friendly_denom", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "'ncheq'" - }, - "exponent": { - "name": "exponent", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "description": { - "name": "description", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "denom_testnet_ledger_denom_unique": { - "name": "denom_testnet_ledger_denom_unique", - "nullsNotDistinct": false, - "columns": ["ledger_denom"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.did_mainnet": { - "name": "did_mainnet", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "did_id": { - "name": "did_id", - "type": "varchar(54)", - "primaryKey": false, - "notNull": true - }, - "operation_type": { - "name": "operation_type", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "fee_payer": { - "name": "fee_payer", - "type": "varchar(44)", - "primaryKey": false, - "notNull": true - }, - "amount": { - "name": "amount", - "type": "numeric", - "primaryKey": false, - "notNull": true - }, - "denom": { - "name": "denom", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "block_height": { - "name": "block_height", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "transaction_hash": { - "name": "transaction_hash", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "success": { - "name": "success", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_did_mainnet_tx_op_did": { - "name": "idx_did_mainnet_tx_op_did", - "columns": [ - { - "expression": "transaction_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "operation_type", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "did_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "did_mainnet_operation_type_operation_types_mainnet_id_fk": { - "name": "did_mainnet_operation_type_operation_types_mainnet_id_fk", - "tableFrom": "did_mainnet", - "tableTo": "operation_types_mainnet", - "columnsFrom": ["operation_type"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "did_mainnet_denom_denom_mainnet_id_fk": { - "name": "did_mainnet_denom_denom_mainnet_id_fk", - "tableFrom": "did_mainnet", - "tableTo": "denom_mainnet", - "columnsFrom": ["denom"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.did_testnet": { - "name": "did_testnet", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "did_id": { - "name": "did_id", - "type": "varchar(54)", - "primaryKey": false, - "notNull": true - }, - "operation_type": { - "name": "operation_type", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "fee_payer": { - "name": "fee_payer", - "type": "varchar(44)", - "primaryKey": false, - "notNull": true - }, - "amount": { - "name": "amount", - "type": "numeric", - "primaryKey": false, - "notNull": true - }, - "denom": { - "name": "denom", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "block_height": { - "name": "block_height", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "transaction_hash": { - "name": "transaction_hash", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "success": { - "name": "success", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_did_testnet_tx_op_did": { - "name": "idx_did_testnet_tx_op_did", - "columns": [ - { - "expression": "transaction_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "operation_type", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "did_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "did_testnet_operation_type_operation_types_testnet_id_fk": { - "name": "did_testnet_operation_type_operation_types_testnet_id_fk", - "tableFrom": "did_testnet", - "tableTo": "operation_types_testnet", - "columnsFrom": ["operation_type"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "did_testnet_denom_denom_testnet_id_fk": { - "name": "did_testnet_denom_denom_testnet_id_fk", - "tableFrom": "did_testnet", - "tableTo": "denom_testnet", - "columnsFrom": ["denom"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.operation_types_mainnet": { - "name": "operation_types_mainnet", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "ledger_operation_type": { - "name": "ledger_operation_type", - "type": "operation_type_enum_mainnet", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "friendly_operation_type": { - "name": "friendly_operation_type", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "'friendly'" - }, - "description": { - "name": "description", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "operation_types_mainnet_ledger_operation_type_unique": { - "name": "operation_types_mainnet_ledger_operation_type_unique", - "nullsNotDistinct": false, - "columns": ["ledger_operation_type"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.operation_types_testnet": { - "name": "operation_types_testnet", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "ledger_operation_type": { - "name": "ledger_operation_type", - "type": "operation_type_enum_testnet", - "typeSchema": "public", - "primaryKey": false, - "notNull": true - }, - "friendly_operation_type": { - "name": "friendly_operation_type", - "type": "varchar", - "primaryKey": false, - "notNull": true, - "default": "'friendly'" - }, - "description": { - "name": "description", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": true, - "default": "now()" - }, - "updated_at": { - "name": "updated_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": { - "operation_types_testnet_ledger_operation_type_unique": { - "name": "operation_types_testnet_ledger_operation_type_unique", - "nullsNotDistinct": false, - "columns": ["ledger_operation_type"] - } - }, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.resource_mainnet": { - "name": "resource_mainnet", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "resource_id": { - "name": "resource_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "resource_type": { - "name": "resource_type", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "resource_name": { - "name": "resource_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "operation_type": { - "name": "operation_type", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "did_id": { - "name": "did_id", - "type": "varchar(54)", - "primaryKey": false, - "notNull": false - }, - "fee_payer": { - "name": "fee_payer", - "type": "varchar(44)", - "primaryKey": false, - "notNull": true - }, - "amount": { - "name": "amount", - "type": "numeric", - "primaryKey": false, - "notNull": true - }, - "denom": { - "name": "denom", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "block_height": { - "name": "block_height", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "transaction_hash": { - "name": "transaction_hash", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "success": { - "name": "success", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_resource_mainnet_tx_op_resource": { - "name": "idx_resource_mainnet_tx_op_resource", - "columns": [ - { - "expression": "transaction_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "operation_type", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "resource_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "resource_mainnet_operation_type_operation_types_mainnet_id_fk": { - "name": "resource_mainnet_operation_type_operation_types_mainnet_id_fk", - "tableFrom": "resource_mainnet", - "tableTo": "operation_types_mainnet", - "columnsFrom": ["operation_type"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "resource_mainnet_denom_denom_mainnet_id_fk": { - "name": "resource_mainnet_denom_denom_mainnet_id_fk", - "tableFrom": "resource_mainnet", - "tableTo": "denom_mainnet", - "columnsFrom": ["denom"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.resource_testnet": { - "name": "resource_testnet", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "serial", - "primaryKey": true, - "notNull": true - }, - "resource_id": { - "name": "resource_id", - "type": "uuid", - "primaryKey": false, - "notNull": true - }, - "resource_type": { - "name": "resource_type", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "resource_name": { - "name": "resource_name", - "type": "varchar", - "primaryKey": false, - "notNull": true - }, - "operation_type": { - "name": "operation_type", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "did_id": { - "name": "did_id", - "type": "varchar(54)", - "primaryKey": false, - "notNull": false - }, - "fee_payer": { - "name": "fee_payer", - "type": "varchar(44)", - "primaryKey": false, - "notNull": true - }, - "amount": { - "name": "amount", - "type": "numeric", - "primaryKey": false, - "notNull": true - }, - "denom": { - "name": "denom", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "block_height": { - "name": "block_height", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "transaction_hash": { - "name": "transaction_hash", - "type": "varchar(64)", - "primaryKey": false, - "notNull": true - }, - "created_at": { - "name": "created_at", - "type": "timestamp", - "primaryKey": false, - "notNull": true - }, - "success": { - "name": "success", - "type": "boolean", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_resource_testnet_tx_op_resource": { - "name": "idx_resource_testnet_tx_op_resource", - "columns": [ - { - "expression": "transaction_hash", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "operation_type", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "resource_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "resource_testnet_operation_type_operation_types_testnet_id_fk": { - "name": "resource_testnet_operation_type_operation_types_testnet_id_fk", - "tableFrom": "resource_testnet", - "tableTo": "operation_types_testnet", - "columnsFrom": ["operation_type"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - }, - "resource_testnet_denom_denom_testnet_id_fk": { - "name": "resource_testnet_denom_denom_testnet_id_fk", - "tableFrom": "resource_testnet", - "tableTo": "denom_testnet", - "columnsFrom": ["denom"], - "columnsTo": ["id"], - "onDelete": "no action", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": { - "public.denoms_enum_mainnet": { - "name": "denoms_enum_mainnet", - "schema": "public", - "values": ["ncheq"] - }, - "public.denoms_enum_testnet": { - "name": "denoms_enum_testnet", - "schema": "public", - "values": ["ncheq"] - }, - "public.operation_type_enum_mainnet": { - "name": "operation_type_enum_mainnet", - "schema": "public", - "values": [ - "cheqd.did.v2.MsgCreateDidDoc", - "cheqd.did.v2.MsgUpdateDidDoc", - "cheqd.did.v2.MsgDeactivateDidDoc", - "cheqd.resource.v2.MsgCreateResource" - ] - }, - "public.operation_type_enum_testnet": { - "name": "operation_type_enum_testnet", - "schema": "public", - "values": [ - "cheqd.did.v2.MsgCreateDidDoc", - "cheqd.did.v2.MsgUpdateDidDoc", - "cheqd.did.v2.MsgDeactivateDidDoc", - "cheqd.resource.v2.MsgCreateResource" - ] - } - }, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} + "id": "29e2517a-42dd-435c-98ea-637d9db432c4", + "prevId": "44c374c8-9d41-4141-a79f-f0743a3d863b", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.denom_mainnet": { + "name": "denom_mainnet", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "ledger_denom": { + "name": "ledger_denom", + "type": "denoms_enum_mainnet", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'ncheq'" + }, + "friendly_denom": { + "name": "friendly_denom", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'CHEQ'" + }, + "exponent": { + "name": "exponent", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "denom_mainnet_ledger_denom_unique": { + "name": "denom_mainnet_ledger_denom_unique", + "nullsNotDistinct": false, + "columns": [ + "ledger_denom" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.denom_testnet": { + "name": "denom_testnet", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "ledger_denom": { + "name": "ledger_denom", + "type": "denoms_enum_testnet", + "typeSchema": "public", + "primaryKey": false, + "notNull": true, + "default": "'ncheq'" + }, + "friendly_denom": { + "name": "friendly_denom", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'ncheq'" + }, + "exponent": { + "name": "exponent", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "denom_testnet_ledger_denom_unique": { + "name": "denom_testnet_ledger_denom_unique", + "nullsNotDistinct": false, + "columns": [ + "ledger_denom" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.did_mainnet": { + "name": "did_mainnet", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "did_id": { + "name": "did_id", + "type": "varchar(54)", + "primaryKey": false, + "notNull": true + }, + "operation_type": { + "name": "operation_type", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "fee_payer": { + "name": "fee_payer", + "type": "varchar(44)", + "primaryKey": false, + "notNull": true + }, + "amount": { + "name": "amount", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "denom": { + "name": "denom", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "block_height": { + "name": "block_height", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "transaction_hash": { + "name": "transaction_hash", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "success": { + "name": "success", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "idx_did_mainnet_tx_op_did": { + "name": "idx_did_mainnet_tx_op_did", + "columns": [ + { + "expression": "transaction_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "operation_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "did_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "did_mainnet_operation_type_operation_types_mainnet_id_fk": { + "name": "did_mainnet_operation_type_operation_types_mainnet_id_fk", + "tableFrom": "did_mainnet", + "tableTo": "operation_types_mainnet", + "columnsFrom": [ + "operation_type" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "did_mainnet_denom_denom_mainnet_id_fk": { + "name": "did_mainnet_denom_denom_mainnet_id_fk", + "tableFrom": "did_mainnet", + "tableTo": "denom_mainnet", + "columnsFrom": [ + "denom" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.did_testnet": { + "name": "did_testnet", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "did_id": { + "name": "did_id", + "type": "varchar(54)", + "primaryKey": false, + "notNull": true + }, + "operation_type": { + "name": "operation_type", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "fee_payer": { + "name": "fee_payer", + "type": "varchar(44)", + "primaryKey": false, + "notNull": true + }, + "amount": { + "name": "amount", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "denom": { + "name": "denom", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "block_height": { + "name": "block_height", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "transaction_hash": { + "name": "transaction_hash", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "success": { + "name": "success", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "idx_did_testnet_tx_op_did": { + "name": "idx_did_testnet_tx_op_did", + "columns": [ + { + "expression": "transaction_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "operation_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "did_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "did_testnet_operation_type_operation_types_testnet_id_fk": { + "name": "did_testnet_operation_type_operation_types_testnet_id_fk", + "tableFrom": "did_testnet", + "tableTo": "operation_types_testnet", + "columnsFrom": [ + "operation_type" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "did_testnet_denom_denom_testnet_id_fk": { + "name": "did_testnet_denom_denom_testnet_id_fk", + "tableFrom": "did_testnet", + "tableTo": "denom_testnet", + "columnsFrom": [ + "denom" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.operation_types_mainnet": { + "name": "operation_types_mainnet", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "ledger_operation_type": { + "name": "ledger_operation_type", + "type": "operation_type_enum_mainnet", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "friendly_operation_type": { + "name": "friendly_operation_type", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'friendly'" + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "operation_types_mainnet_ledger_operation_type_unique": { + "name": "operation_types_mainnet_ledger_operation_type_unique", + "nullsNotDistinct": false, + "columns": [ + "ledger_operation_type" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.operation_types_testnet": { + "name": "operation_types_testnet", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "ledger_operation_type": { + "name": "ledger_operation_type", + "type": "operation_type_enum_testnet", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "friendly_operation_type": { + "name": "friendly_operation_type", + "type": "varchar", + "primaryKey": false, + "notNull": true, + "default": "'friendly'" + }, + "description": { + "name": "description", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "operation_types_testnet_ledger_operation_type_unique": { + "name": "operation_types_testnet_ledger_operation_type_unique", + "nullsNotDistinct": false, + "columns": [ + "ledger_operation_type" + ] + } + }, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resource_mainnet": { + "name": "resource_mainnet", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "resource_id": { + "name": "resource_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "resource_type": { + "name": "resource_type", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "resource_name": { + "name": "resource_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "operation_type": { + "name": "operation_type", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "did_id": { + "name": "did_id", + "type": "varchar(54)", + "primaryKey": false, + "notNull": false + }, + "fee_payer": { + "name": "fee_payer", + "type": "varchar(44)", + "primaryKey": false, + "notNull": true + }, + "amount": { + "name": "amount", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "denom": { + "name": "denom", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "block_height": { + "name": "block_height", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "transaction_hash": { + "name": "transaction_hash", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "success": { + "name": "success", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "idx_resource_mainnet_tx_op_resource": { + "name": "idx_resource_mainnet_tx_op_resource", + "columns": [ + { + "expression": "transaction_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "operation_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "resource_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "resource_mainnet_operation_type_operation_types_mainnet_id_fk": { + "name": "resource_mainnet_operation_type_operation_types_mainnet_id_fk", + "tableFrom": "resource_mainnet", + "tableTo": "operation_types_mainnet", + "columnsFrom": [ + "operation_type" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "resource_mainnet_denom_denom_mainnet_id_fk": { + "name": "resource_mainnet_denom_denom_mainnet_id_fk", + "tableFrom": "resource_mainnet", + "tableTo": "denom_mainnet", + "columnsFrom": [ + "denom" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.resource_testnet": { + "name": "resource_testnet", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "resource_id": { + "name": "resource_id", + "type": "uuid", + "primaryKey": false, + "notNull": true + }, + "resource_type": { + "name": "resource_type", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "resource_name": { + "name": "resource_name", + "type": "varchar", + "primaryKey": false, + "notNull": true + }, + "operation_type": { + "name": "operation_type", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "did_id": { + "name": "did_id", + "type": "varchar(54)", + "primaryKey": false, + "notNull": false + }, + "fee_payer": { + "name": "fee_payer", + "type": "varchar(44)", + "primaryKey": false, + "notNull": true + }, + "amount": { + "name": "amount", + "type": "numeric", + "primaryKey": false, + "notNull": true + }, + "denom": { + "name": "denom", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "block_height": { + "name": "block_height", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "transaction_hash": { + "name": "transaction_hash", + "type": "varchar(64)", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "success": { + "name": "success", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "idx_resource_testnet_tx_op_resource": { + "name": "idx_resource_testnet_tx_op_resource", + "columns": [ + { + "expression": "transaction_hash", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "operation_type", + "isExpression": false, + "asc": true, + "nulls": "last" + }, + { + "expression": "resource_id", + "isExpression": false, + "asc": true, + "nulls": "last" + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "resource_testnet_operation_type_operation_types_testnet_id_fk": { + "name": "resource_testnet_operation_type_operation_types_testnet_id_fk", + "tableFrom": "resource_testnet", + "tableTo": "operation_types_testnet", + "columnsFrom": [ + "operation_type" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "resource_testnet_denom_denom_testnet_id_fk": { + "name": "resource_testnet_denom_denom_testnet_id_fk", + "tableFrom": "resource_testnet", + "tableTo": "denom_testnet", + "columnsFrom": [ + "denom" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.denoms_enum_mainnet": { + "name": "denoms_enum_mainnet", + "schema": "public", + "values": [ + "ncheq" + ] + }, + "public.denoms_enum_testnet": { + "name": "denoms_enum_testnet", + "schema": "public", + "values": [ + "ncheq" + ] + }, + "public.operation_type_enum_mainnet": { + "name": "operation_type_enum_mainnet", + "schema": "public", + "values": [ + "cheqd.did.v2.MsgCreateDidDoc", + "cheqd.did.v2.MsgUpdateDidDoc", + "cheqd.did.v2.MsgDeactivateDidDoc", + "cheqd.resource.v2.MsgCreateResource" + ] + }, + "public.operation_type_enum_testnet": { + "name": "operation_type_enum_testnet", + "schema": "public", + "values": [ + "cheqd.did.v2.MsgCreateDidDoc", + "cheqd.did.v2.MsgUpdateDidDoc", + "cheqd.did.v2.MsgDeactivateDidDoc", + "cheqd.resource.v2.MsgCreateResource" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/src/database/migrations/meta/_journal.json b/src/database/migrations/meta/_journal.json index dd66051..c18b2dd 100644 --- a/src/database/migrations/meta/_journal.json +++ b/src/database/migrations/meta/_journal.json @@ -1,41 +1,41 @@ { - "version": "7", - "dialect": "postgresql", - "entries": [ - { - "idx": 0, - "version": "7", - "when": 1741197616979, - "tag": "0000_salty_machine_man", - "breakpoints": true - }, - { - "idx": 1, - "version": "7", - "when": 1741392062249, - "tag": "0001_hard_jane_foster", - "breakpoints": true - }, - { - "idx": 2, - "version": "7", - "when": 1741705797047, - "tag": "0002_dazzling_colossus", - "breakpoints": true - }, - { - "idx": 3, - "version": "7", - "when": 1741774436871, - "tag": "0003_overjoyed_elektra", - "breakpoints": true - }, - { - "idx": 4, - "version": "7", - "when": 1768983905645, - "tag": "0004_sloppy_paladin", - "breakpoints": true - } - ] -} + "version": "7", + "dialect": "postgresql", + "entries": [ + { + "idx": 0, + "version": "7", + "when": 1741197616979, + "tag": "0000_salty_machine_man", + "breakpoints": true + }, + { + "idx": 1, + "version": "7", + "when": 1741392062249, + "tag": "0001_hard_jane_foster", + "breakpoints": true + }, + { + "idx": 2, + "version": "7", + "when": 1741705797047, + "tag": "0002_dazzling_colossus", + "breakpoints": true + }, + { + "idx": 3, + "version": "7", + "when": 1741774436871, + "tag": "0003_overjoyed_elektra", + "breakpoints": true + }, + { + "idx": 4, + "version": "7", + "when": 1768983905645, + "tag": "0004_sloppy_paladin", + "breakpoints": true + } + ] +} \ No newline at end of file