Search/AdvisoryAI and DAL conversion to EF finishes up. Preparation for microservices consolidation.

This commit is contained in:
master
2026-02-25 18:19:22 +02:00
parent 4db038123b
commit 63c70a6d37
447 changed files with 52257 additions and 2636 deletions

View File

@@ -0,0 +1,74 @@
-- ============================================================================
-- Provcache — Initial Schema
-- Extracted from ProvcacheDbContext OnModelCreating
-- ============================================================================
CREATE SCHEMA IF NOT EXISTS provcache;
-- Provcache items (verification cache entries)
CREATE TABLE IF NOT EXISTS provcache.provcache_item_entity (
veri_key VARCHAR(512) PRIMARY KEY,
digest_version VARCHAR(16) NOT NULL,
verdict_hash VARCHAR(128) NOT NULL,
proof_root VARCHAR(128) NOT NULL,
replay_seed JSONB NOT NULL,
policy_hash VARCHAR(128) NOT NULL,
signer_set_hash VARCHAR(128) NOT NULL,
feed_epoch VARCHAR(64) NOT NULL,
trust_score INTEGER NOT NULL DEFAULT 0,
hit_count BIGINT NOT NULL DEFAULT 0,
created_at TIMESTAMPTZ NOT NULL,
expires_at TIMESTAMPTZ NOT NULL,
updated_at TIMESTAMPTZ NOT NULL,
last_accessed_at TIMESTAMPTZ
);
CREATE INDEX IF NOT EXISTS ix_provcache_items_policy_hash
ON provcache.provcache_item_entity (policy_hash);
CREATE INDEX IF NOT EXISTS ix_provcache_items_signer_set_hash
ON provcache.provcache_item_entity (signer_set_hash);
CREATE INDEX IF NOT EXISTS ix_provcache_items_feed_epoch
ON provcache.provcache_item_entity (feed_epoch);
CREATE INDEX IF NOT EXISTS ix_provcache_items_expires_at
ON provcache.provcache_item_entity (expires_at);
CREATE INDEX IF NOT EXISTS ix_provcache_items_created_at
ON provcache.provcache_item_entity (created_at);
-- Evidence chunks
CREATE TABLE IF NOT EXISTS provcache.provcache_evidence_chunk_entity (
chunk_id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
proof_root VARCHAR(128) NOT NULL,
chunk_index INTEGER NOT NULL,
chunk_hash VARCHAR(128) NOT NULL,
blob BYTEA NOT NULL,
blob_size INTEGER NOT NULL,
content_type VARCHAR(128) NOT NULL,
created_at TIMESTAMPTZ NOT NULL
);
CREATE INDEX IF NOT EXISTS ix_provcache_evidence_chunks_proof_root
ON provcache.provcache_evidence_chunk_entity (proof_root);
CREATE UNIQUE INDEX IF NOT EXISTS ix_provcache_evidence_chunks_proof_root_chunk_index
ON provcache.provcache_evidence_chunk_entity (proof_root, chunk_index);
-- Revocations
CREATE TABLE IF NOT EXISTS provcache.provcache_revocation_entity (
revocation_id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
revocation_type VARCHAR(64) NOT NULL,
target_hash VARCHAR(256) NOT NULL,
reason VARCHAR(512),
actor VARCHAR(256),
entries_affected BIGINT NOT NULL,
created_at TIMESTAMPTZ NOT NULL
);
CREATE INDEX IF NOT EXISTS ix_provcache_revocations_created_at
ON provcache.provcache_revocation_entity (created_at);
CREATE INDEX IF NOT EXISTS ix_provcache_revocations_target_hash
ON provcache.provcache_revocation_entity (target_hash);