bae705aa97
- Add NFC ePassport roadmap (ICAO 9303, eIDAS) - Add TensorFlow.js edge face detection (BlazeFace) - Add structured audit logger (GDPR-compliant) - Risk scoring support Part of KYC Apple Native UX v1.1.0
17 lines
645 B
SQL
17 lines
645 B
SQL
CREATE TABLE IF NOT EXISTS journal_lines (
|
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
journal_entry_id UUID NOT NULL REFERENCES journal_entries(id) ON DELETE CASCADE,
|
|
account_id UUID NOT NULL REFERENCES accounts(id),
|
|
description TEXT,
|
|
debit NUMERIC(19, 4),
|
|
credit NUMERIC(19, 4),
|
|
CONSTRAINT check_debit_credit CHECK (
|
|
(debit IS NOT NULL AND credit IS NULL) OR
|
|
(debit IS NULL AND credit IS NOT NULL) OR
|
|
(debit IS NULL AND credit IS NULL)
|
|
)
|
|
);
|
|
|
|
CREATE INDEX idx_journal_lines_entry ON journal_lines(journal_entry_id);
|
|
CREATE INDEX idx_journal_lines_account ON journal_lines(account_id);
|