Coverage for downtify/db/migrations/schema/doctor.py: 100%

2 statements  

« prev     ^ index     » next       coverage.py v7.17.4, created at 2026-11-21 22:18 +0000

1"""Postgres DDL for the Doctor's audio-hash cache and kept-apart pairs. 

2 

3Mirrors :class:`downtify.doctor_audio.AudioHashCache` and 

4:class:`downtify.duplicate_merge.KeptApart`. 

5""" 

6 

7from __future__ import annotations 

8 

9DDL: list[str] = [ 

10 """ 

11 CREATE TABLE IF NOT EXISTS audio_hashes ( 

12 path TEXT PRIMARY KEY, 

13 size BIGINT NOT NULL, 

14 mtime_ns BIGINT NOT NULL, 

15 digest TEXT NOT NULL 

16 ) 

17 """, 

18 """ 

19 CREATE TABLE IF NOT EXISTS kept_apart ( 

20 a TEXT NOT NULL, 

21 b TEXT NOT NULL, 

22 kept_at TEXT NOT NULL, 

23 PRIMARY KEY (a, b) 

24 ) 

25 """, 

26]