{ "version": "6", "dialect": "sqlite", "id": "1c05f813-8105-4ff8-a5ae-35b442ecc816", "prevId": "5d13c375-da15-493b-b1cd-2c7836d43813", "tables": { "account_deletion_requests": { "name": "account_deletion_requests", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "account_id": { "name": "account_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'requested'" }, "reason": { "name": "reason", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "requested_at": { "name": "requested_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "cancelled_at": { "name": "cancelled_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" }, "updated_at": { "name": "updated_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" } }, "indexes": { "idx_account_deletion_one_requested": { "name": "idx_account_deletion_one_requested", "columns": [ "account_id" ], "isUnique": true, "where": "\"account_deletion_requests\".\"status\" = 'requested'" }, "idx_account_deletion_status_time": { "name": "idx_account_deletion_status_time", "columns": [ "status", "requested_at" ], "isUnique": false } }, "foreignKeys": { "account_deletion_requests_account_id_accounts_id_fk": { "name": "account_deletion_requests_account_id_accounts_id_fk", "tableFrom": "account_deletion_requests", "tableTo": "accounts", "columnsFrom": [ "account_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "accounts": { "name": "accounts", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "auth_subject": { "name": "auth_subject", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "email": { "name": "email", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "display_name": { "name": "display_name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'active'" }, "created_at": { "name": "created_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" }, "updated_at": { "name": "updated_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" } }, "indexes": { "idx_accounts_auth_subject": { "name": "idx_accounts_auth_subject", "columns": [ "auth_subject" ], "isUnique": true }, "idx_accounts_email": { "name": "idx_accounts_email", "columns": [ "email" ], "isUnique": false } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "audit_events": { "name": "audit_events", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "actor_id": { "name": "actor_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "action": { "name": "action", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "target_type": { "name": "target_type", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "target_id": { "name": "target_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "reason": { "name": "reason", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "before_json": { "name": "before_json", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "after_json": { "name": "after_json", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "correlation_id": { "name": "correlation_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" } }, "indexes": { "idx_audit_target_time": { "name": "idx_audit_target_time", "columns": [ "target_type", "target_id", "created_at" ], "isUnique": false }, "idx_audit_actor_time": { "name": "idx_audit_actor_time", "columns": [ "actor_id", "created_at" ], "isUnique": false } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "beta_feedback": { "name": "beta_feedback", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "account_id": { "name": "account_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "category": { "name": "category", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "message": { "name": "message", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'open'" }, "admin_response": { "name": "admin_response", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "handled_by": { "name": "handled_by", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" }, "updated_at": { "name": "updated_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" }, "resolved_at": { "name": "resolved_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": { "idx_beta_feedback_account_time": { "name": "idx_beta_feedback_account_time", "columns": [ "account_id", "created_at" ], "isUnique": false }, "idx_beta_feedback_status_time": { "name": "idx_beta_feedback_status_time", "columns": [ "status", "created_at" ], "isUnique": false } }, "foreignKeys": { "beta_feedback_account_id_accounts_id_fk": { "name": "beta_feedback_account_id_accounts_id_fk", "tableFrom": "beta_feedback", "tableTo": "accounts", "columnsFrom": [ "account_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "beta_programs": { "name": "beta_programs", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "state": { "name": "state", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "capacity_slots": { "name": "capacity_slots", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "starts_at": { "name": "starts_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "ends_at": { "name": "ends_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "grace_days": { "name": "grace_days", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 7 }, "created_by": { "name": "created_by", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" }, "retired_at": { "name": "retired_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": { "idx_beta_state_time": { "name": "idx_beta_state_time", "columns": [ "state", "starts_at" ], "isUnique": false } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "cloud_schema_migrations": { "name": "cloud_schema_migrations", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "applied_at": { "name": "applied_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "device_credentials": { "name": "device_credentials", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "host_id": { "name": "host_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "token_hash": { "name": "token_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'active'" }, "issued_at": { "name": "issued_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "expires_at": { "name": "expires_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "last_used_at": { "name": "last_used_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "revoked_at": { "name": "revoked_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" } }, "indexes": { "idx_device_credentials_token_hash": { "name": "idx_device_credentials_token_hash", "columns": [ "token_hash" ], "isUnique": true }, "idx_device_credentials_host_status": { "name": "idx_device_credentials_host_status", "columns": [ "host_id", "status" ], "isUnique": false } }, "foreignKeys": { "device_credentials_host_id_hosts_id_fk": { "name": "device_credentials_host_id_hosts_id_fk", "tableFrom": "device_credentials", "tableTo": "hosts", "columnsFrom": [ "host_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "entitlement_grants": { "name": "entitlement_grants", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "account_id": { "name": "account_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "host_id": { "name": "host_id", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "source": { "name": "source", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "source_ref": { "name": "source_ref", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "capacity_slots": { "name": "capacity_slots", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "starts_at": { "name": "starts_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "ends_at": { "name": "ends_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "state": { "name": "state", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'scheduled'" }, "reason": { "name": "reason", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_by": { "name": "created_by", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" }, "revoked_at": { "name": "revoked_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": { "idx_grants_account_state_time": { "name": "idx_grants_account_state_time", "columns": [ "account_id", "state", "starts_at" ], "isUnique": false }, "idx_grants_source_ref": { "name": "idx_grants_source_ref", "columns": [ "source", "source_ref" ], "isUnique": true } }, "foreignKeys": { "entitlement_grants_account_id_accounts_id_fk": { "name": "entitlement_grants_account_id_accounts_id_fk", "tableFrom": "entitlement_grants", "tableTo": "accounts", "columnsFrom": [ "account_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "entitlement_grants_host_id_hosts_id_fk": { "name": "entitlement_grants_host_id_hosts_id_fk", "tableFrom": "entitlement_grants", "tableTo": "hosts", "columnsFrom": [ "host_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "hosts": { "name": "hosts", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "account_id": { "name": "account_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "name": { "name": "name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "os": { "name": "os", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "lifecycle": { "name": "lifecycle", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'active'" }, "slot_state": { "name": "slot_state", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'active'" }, "connection_state": { "name": "connection_state", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'unknown'" }, "daemon_version": { "name": "daemon_version", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "recovery_fingerprint": { "name": "recovery_fingerprint", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "ed25519_public": { "name": "ed25519_public", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "x25519_public": { "name": "x25519_public", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "identity_fingerprint": { "name": "identity_fingerprint", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "claim_request_id": { "name": "claim_request_id", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "claimed_at": { "name": "claimed_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "last_seen_at": { "name": "last_seen_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" }, "deactivated_at": { "name": "deactivated_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": { "idx_hosts_account_lifecycle": { "name": "idx_hosts_account_lifecycle", "columns": [ "account_id", "lifecycle" ], "isUnique": false }, "idx_hosts_recovery_fingerprint": { "name": "idx_hosts_recovery_fingerprint", "columns": [ "recovery_fingerprint" ], "isUnique": true }, "idx_hosts_identity_fingerprint": { "name": "idx_hosts_identity_fingerprint", "columns": [ "identity_fingerprint" ], "isUnique": true } }, "foreignKeys": { "hosts_account_id_accounts_id_fk": { "name": "hosts_account_id_accounts_id_fk", "tableFrom": "hosts", "tableTo": "accounts", "columnsFrom": [ "account_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "idempotency_records": { "name": "idempotency_records", "columns": { "scope": { "name": "scope", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "key": { "name": "key", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "request_hash": { "name": "request_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "response_json": { "name": "response_json", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "status_code": { "name": "status_code", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "expires_at": { "name": "expires_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" } }, "indexes": { "idx_idempotency_expires": { "name": "idx_idempotency_expires", "columns": [ "expires_at" ], "isUnique": false } }, "foreignKeys": {}, "compositePrimaryKeys": { "idempotency_records_scope_key_pk": { "columns": [ "scope", "key" ], "name": "idempotency_records_scope_key_pk" } }, "uniqueConstraints": {}, "checkConstraints": {} }, "invoices": { "name": "invoices", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "order_id": { "name": "order_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "invoice_type": { "name": "invoice_type", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'commercial'" }, "invoice_number": { "name": "invoice_number", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "amount_minor": { "name": "amount_minor", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "tax_minor": { "name": "tax_minor", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "currency": { "name": "currency", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'draft'" }, "document_ref": { "name": "document_ref", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" }, "updated_at": { "name": "updated_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" } }, "indexes": { "idx_invoices_order": { "name": "idx_invoices_order", "columns": [ "order_id" ], "isUnique": true } }, "foreignKeys": { "invoices_order_id_orders_id_fk": { "name": "invoices_order_id_orders_id_fk", "tableFrom": "invoices", "tableTo": "orders", "columnsFrom": [ "order_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "launch_gates": { "name": "launch_gates", "columns": { "key": { "name": "key", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "priority": { "name": "priority", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "category": { "name": "category", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "title": { "name": "title", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'blocked'" }, "owner": { "name": "owner", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "evidence_url": { "name": "evidence_url", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "notes": { "name": "notes", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "''" }, "reviewed_at": { "name": "reviewed_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "updated_at": { "name": "updated_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" } }, "indexes": { "idx_launch_gates_status": { "name": "idx_launch_gates_status", "columns": [ "priority", "status" ], "isUnique": false } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "orders": { "name": "orders", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "account_id": { "name": "account_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "client_order_id": { "name": "client_order_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "kind": { "name": "kind", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'purchase'" }, "price_version_id": { "name": "price_version_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "slot_quantity": { "name": "slot_quantity", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "term_start": { "name": "term_start", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "term_end": { "name": "term_end", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "amount_minor": { "name": "amount_minor", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "currency": { "name": "currency", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'draft'" }, "quote_expires_at": { "name": "quote_expires_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" }, "updated_at": { "name": "updated_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" } }, "indexes": { "idx_orders_account_client": { "name": "idx_orders_account_client", "columns": [ "account_id", "client_order_id" ], "isUnique": true }, "idx_orders_account_status": { "name": "idx_orders_account_status", "columns": [ "account_id", "status" ], "isUnique": false } }, "foreignKeys": { "orders_account_id_accounts_id_fk": { "name": "orders_account_id_accounts_id_fk", "tableFrom": "orders", "tableTo": "accounts", "columnsFrom": [ "account_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "orders_price_version_id_price_versions_id_fk": { "name": "orders_price_version_id_price_versions_id_fk", "tableFrom": "orders", "tableTo": "price_versions", "columnsFrom": [ "price_version_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "pairing_claim_attempts": { "name": "pairing_claim_attempts", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "pairing_request_id": { "name": "pairing_request_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "source_hash": { "name": "source_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "outcome": { "name": "outcome", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" } }, "indexes": { "idx_pairing_claim_attempts_target_time": { "name": "idx_pairing_claim_attempts_target_time", "columns": [ "pairing_request_id", "created_at" ], "isUnique": false }, "idx_pairing_claim_attempts_source_time": { "name": "idx_pairing_claim_attempts_source_time", "columns": [ "source_hash", "created_at" ], "isUnique": false } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "pairing_claim_rate_limits": { "name": "pairing_claim_rate_limits", "columns": { "source_hash": { "name": "source_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "window_start": { "name": "window_start", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "attempts": { "name": "attempts", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 1 }, "updated_at": { "name": "updated_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false } }, "indexes": {}, "foreignKeys": {}, "compositePrimaryKeys": { "pairing_claim_rate_limits_source_hash_window_start_pk": { "columns": [ "source_hash", "window_start" ], "name": "pairing_claim_rate_limits_source_hash_window_start_pk" } }, "uniqueConstraints": {}, "checkConstraints": {} }, "pairing_requests": { "name": "pairing_requests", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "account_id": { "name": "account_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "requested_name": { "name": "requested_name", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "os": { "name": "os", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "code_hash": { "name": "code_hash", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'waiting'" }, "expires_at": { "name": "expires_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "claimed_host_id": { "name": "claimed_host_id", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "failed_attempts": { "name": "failed_attempts", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 0 }, "locked_at": { "name": "locked_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "last_attempt_at": { "name": "last_attempt_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" }, "claimed_at": { "name": "claimed_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false } }, "indexes": { "idx_pairing_code_hash": { "name": "idx_pairing_code_hash", "columns": [ "code_hash" ], "isUnique": true }, "idx_pairing_account_status": { "name": "idx_pairing_account_status", "columns": [ "account_id", "status" ], "isUnique": false } }, "foreignKeys": { "pairing_requests_account_id_accounts_id_fk": { "name": "pairing_requests_account_id_accounts_id_fk", "tableFrom": "pairing_requests", "tableTo": "accounts", "columnsFrom": [ "account_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "pairing_requests_claimed_host_id_hosts_id_fk": { "name": "pairing_requests_claimed_host_id_hosts_id_fk", "tableFrom": "pairing_requests", "tableTo": "hosts", "columnsFrom": [ "claimed_host_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "payment_attempts": { "name": "payment_attempts", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "order_id": { "name": "order_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "provider": { "name": "provider", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "provider_payment_ref": { "name": "provider_payment_ref", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "provider_event_id": { "name": "provider_event_id", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "amount_minor": { "name": "amount_minor", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "currency": { "name": "currency", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'created'" }, "created_at": { "name": "created_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" }, "updated_at": { "name": "updated_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" } }, "indexes": { "idx_payments_provider_event": { "name": "idx_payments_provider_event", "columns": [ "provider", "provider_event_id" ], "isUnique": true }, "idx_payments_provider_ref": { "name": "idx_payments_provider_ref", "columns": [ "provider", "provider_payment_ref" ], "isUnique": true } }, "foreignKeys": { "payment_attempts_order_id_orders_id_fk": { "name": "payment_attempts_order_id_orders_id_fk", "tableFrom": "payment_attempts", "tableTo": "orders", "columnsFrom": [ "order_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "price_versions": { "name": "price_versions", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "product_code": { "name": "product_code", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'host_slot'" }, "billing_period": { "name": "billing_period", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "unit_slots": { "name": "unit_slots", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 1 }, "amount_minor": { "name": "amount_minor", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "currency": { "name": "currency", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'CNY'" }, "tax_mode": { "name": "tax_mode", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'undecided'" }, "quote_ttl_seconds": { "name": "quote_ttl_seconds", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 900 }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'draft'" }, "effective_from": { "name": "effective_from", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "effective_to": { "name": "effective_to", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_by": { "name": "created_by", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" } }, "indexes": { "idx_prices_catalog": { "name": "idx_prices_catalog", "columns": [ "product_code", "billing_period", "status" ], "isUnique": false } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "provisioner_workers": { "name": "provisioner_workers", "columns": { "tenant_id": { "name": "tenant_id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "worker_id": { "name": "worker_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "poll_count": { "name": "poll_count", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 1 }, "last_seen_at": { "name": "last_seen_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "created_at": { "name": "created_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" }, "updated_at": { "name": "updated_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" } }, "indexes": {}, "foreignKeys": { "provisioner_workers_tenant_id_tenant_instances_id_fk": { "name": "provisioner_workers_tenant_id_tenant_instances_id_fk", "tableFrom": "provisioner_workers", "tableTo": "tenant_instances", "columnsFrom": [ "tenant_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "provisioning_operations": { "name": "provisioning_operations", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "tenant_id": { "name": "tenant_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "operation": { "name": "operation", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "idempotency_key": { "name": "idempotency_key", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "correlation_id": { "name": "correlation_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "target_generation": { "name": "target_generation", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "predecessor_id": { "name": "predecessor_id", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "credential_revision": { "name": "credential_revision", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 0 }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'requested'" }, "requested_by": { "name": "requested_by", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'system:legacy'" }, "reason": { "name": "reason", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'legacy provisioning request'" }, "lifecycle_before": { "name": "lifecycle_before", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'requested'" }, "payload_version": { "name": "payload_version", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 1 }, "lease_owner": { "name": "lease_owner", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "lease_token_hash": { "name": "lease_token_hash", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "lease_expires_at": { "name": "lease_expires_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "attempt_count": { "name": "attempt_count", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 0 }, "max_attempts": { "name": "max_attempts", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 5 }, "fence_epoch": { "name": "fence_epoch", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 0 }, "started_at": { "name": "started_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "completed_at": { "name": "completed_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "completion_hash": { "name": "completion_hash", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "result_version": { "name": "result_version", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "observed_generation": { "name": "observed_generation", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "result_runtime_ref": { "name": "result_runtime_ref", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "result_runtime_version": { "name": "result_runtime_version", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "result_relay_origin": { "name": "result_relay_origin", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "result_secret_bundle_ref": { "name": "result_secret_bundle_ref", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "health_status": { "name": "health_status", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "health_checked_at": { "name": "health_checked_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "error_code": { "name": "error_code", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "error_detail": { "name": "error_detail", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" }, "updated_at": { "name": "updated_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" } }, "indexes": { "idx_operations_idempotency": { "name": "idx_operations_idempotency", "columns": [ "tenant_id", "idempotency_key" ], "isUnique": true }, "idx_operations_one_active_tenant": { "name": "idx_operations_one_active_tenant", "columns": [ "tenant_id" ], "isUnique": true, "where": "\"provisioning_operations\".\"status\" IN ('requested', 'leased')" }, "idx_operations_status": { "name": "idx_operations_status", "columns": [ "status" ], "isUnique": false }, "idx_operations_lease_expiry": { "name": "idx_operations_lease_expiry", "columns": [ "status", "lease_expires_at" ], "isUnique": false } }, "foreignKeys": { "provisioning_operations_tenant_id_tenant_instances_id_fk": { "name": "provisioning_operations_tenant_id_tenant_instances_id_fk", "tableFrom": "provisioning_operations", "tableTo": "tenant_instances", "columnsFrom": [ "tenant_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "refunds": { "name": "refunds", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "payment_attempt_id": { "name": "payment_attempt_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "invoice_id": { "name": "invoice_id", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "amount_minor": { "name": "amount_minor", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false }, "currency": { "name": "currency", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "reason": { "name": "reason", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'requested'" }, "entitlement_effect": { "name": "entitlement_effect", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'pending'" }, "created_at": { "name": "created_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" }, "updated_at": { "name": "updated_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" } }, "indexes": { "idx_refunds_payment": { "name": "idx_refunds_payment", "columns": [ "payment_attempt_id" ], "isUnique": false } }, "foreignKeys": { "refunds_payment_attempt_id_payment_attempts_id_fk": { "name": "refunds_payment_attempt_id_payment_attempts_id_fk", "tableFrom": "refunds", "tableTo": "payment_attempts", "columnsFrom": [ "payment_attempt_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" }, "refunds_invoice_id_invoices_id_fk": { "name": "refunds_invoice_id_invoices_id_fk", "tableFrom": "refunds", "tableTo": "invoices", "columnsFrom": [ "invoice_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "service_incidents": { "name": "service_incidents", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "severity": { "name": "severity", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "title": { "name": "title", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "message": { "name": "message", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "status": { "name": "status", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'active'" }, "created_by": { "name": "created_by", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "resolved_by": { "name": "resolved_by", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "resolution": { "name": "resolution", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "started_at": { "name": "started_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "resolved_at": { "name": "resolved_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" }, "updated_at": { "name": "updated_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" } }, "indexes": { "idx_service_incidents_status_started": { "name": "idx_service_incidents_status_started", "columns": [ "status", "started_at" ], "isUnique": false } }, "foreignKeys": {}, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} }, "tenant_instances": { "name": "tenant_instances", "columns": { "id": { "name": "id", "type": "text", "primaryKey": true, "notNull": true, "autoincrement": false }, "account_id": { "name": "account_id", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "slug": { "name": "slug", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false }, "lifecycle": { "name": "lifecycle", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'requested'" }, "desired_state": { "name": "desired_state", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'requested'" }, "observed_state": { "name": "observed_state", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "'absent'" }, "desired_generation": { "name": "desired_generation", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 1 }, "active_generation": { "name": "active_generation", "type": "integer", "primaryKey": false, "notNull": false, "autoincrement": false }, "credential_revision": { "name": "credential_revision", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": 0 }, "runtime_version": { "name": "runtime_version", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "runtime_ref": { "name": "runtime_ref", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "relay_origin": { "name": "relay_origin", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "secret_bundle_ref": { "name": "secret_bundle_ref", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "relay_ready": { "name": "relay_ready", "type": "integer", "primaryKey": false, "notNull": true, "autoincrement": false, "default": false }, "last_health_at": { "name": "last_health_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "tombstoned_at": { "name": "tombstoned_at", "type": "text", "primaryKey": false, "notNull": false, "autoincrement": false }, "created_at": { "name": "created_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" }, "updated_at": { "name": "updated_at", "type": "text", "primaryKey": false, "notNull": true, "autoincrement": false, "default": "CURRENT_TIMESTAMP" } }, "indexes": { "idx_tenants_account": { "name": "idx_tenants_account", "columns": [ "account_id" ], "isUnique": true }, "idx_tenants_slug": { "name": "idx_tenants_slug", "columns": [ "slug" ], "isUnique": true } }, "foreignKeys": { "tenant_instances_account_id_accounts_id_fk": { "name": "tenant_instances_account_id_accounts_id_fk", "tableFrom": "tenant_instances", "tableTo": "accounts", "columnsFrom": [ "account_id" ], "columnsTo": [ "id" ], "onDelete": "no action", "onUpdate": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": {}, "checkConstraints": {} } }, "views": {}, "enums": {}, "_meta": { "schemas": {}, "tables": {}, "columns": {} }, "internal": { "indexes": {} } }