Skip to content

Commit 3c5ed1d

Browse files
docs: Update database schema in README to match current implementation - Add missing prompt_template field - Update year_of_death constraint - Add comprehensive field descriptions for prompt modularization fields
1 parent 4f8484b commit 3c5ed1d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ CREATE TABLE memorials (
2727
memorial_number INTEGER,
2828
first_name TEXT,
2929
last_name TEXT,
30-
year_of_death INTEGER,
30+
year_of_death INTEGER CONSTRAINT valid_year CHECK (year_of_death IS NULL OR (year_of_death > 1500 AND year_of_death <= 2100 AND typeof(year_of_death) = 'integer')),
3131
inscription TEXT,
3232
file_name TEXT NOT NULL,
3333
ai_provider TEXT,
3434
model_version TEXT,
35+
prompt_template TEXT,
3536
prompt_version TEXT,
36-
processed_date DATETIME DEFAULT CURRENT_TIMESTAMP,
37-
CONSTRAINT valid_year CHECK (year_of_death > 1500 AND year_of_death < strftime('%Y', 'now', '+1 year'))
38-
)
37+
processed_date DATETIME DEFAULT CURRENT_TIMESTAMP
38+
);
3939

4040
-- Indexes for optimized queries
4141
CREATE INDEX idx_memorial_number ON memorials(memorial_number);
@@ -45,9 +45,13 @@ CREATE INDEX idx_year ON memorials(year_of_death);
4545

4646
### Data Types and Constraints
4747
- `memorial_number`: Integer for consistent numeric handling
48-
- `year_of_death`: Integer with validation (must be between 1500 and current year + 1)
48+
- `year_of_death`: Integer with validation (must be between 1500 and 2100, allows NULL)
4949
- `file_name`: Required field (NOT NULL)
50+
- `ai_provider`: Tracks which AI service was used (e.g., 'openai', 'anthropic')
51+
- `model_version`: Records the specific model version used
52+
- `prompt_template`: Stores the prompt template used for extraction
5053
- `prompt_version`: Tracks the version of the prompt used for extraction
54+
- `processed_date`: Timestamp of when the record was processed
5155
- Optimized indexes for common search patterns
5256

5357
## How It Works

0 commit comments

Comments
 (0)