crates: production models and repo layer
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Iceb76724c09eaca7ca5d823010db76776a6a6964
This commit is contained in:
parent
17fb0bbe80
commit
1b12be3f8a
31 changed files with 3841 additions and 12 deletions
14
crates/common/migrations/006_hardening.sql
Normal file
14
crates/common/migrations/006_hardening.sql
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
-- Hardening: indexes for performance
|
||||
|
||||
-- Cache lookup index (prefix match on path)
|
||||
CREATE INDEX IF NOT EXISTS idx_build_products_path_prefix ON build_products (path text_pattern_ops);
|
||||
|
||||
-- Composite index for pending builds query
|
||||
CREATE INDEX IF NOT EXISTS idx_builds_pending_priority ON builds (status, priority DESC, created_at ASC)
|
||||
WHERE status = 'pending';
|
||||
|
||||
-- System filtering index
|
||||
CREATE INDEX IF NOT EXISTS idx_builds_system ON builds(system) WHERE system IS NOT NULL;
|
||||
|
||||
-- Deduplication lookup by drv_path + status
|
||||
CREATE INDEX IF NOT EXISTS idx_builds_drv_completed ON builds(drv_path) WHERE status = 'completed';
|
||||
Loading…
Add table
Add a link
Reference in a new issue