home / buchhaltung

links

Data license: Intern · Data source: PayPal CSV + PDF-Belege

0 rows where transaction_id = 10

✎ View and edit SQL

This data as json

0 records

CREATE TABLE links (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    receipt_id INTEGER REFERENCES receipts(id),
    transaction_id INTEGER REFERENCES transactions(id),
    booking_id INTEGER REFERENCES bookings(id),
    linked_at TEXT DEFAULT (datetime('now')),
    CHECK (
        (receipt_id IS NOT NULL AND transaction_id IS NOT NULL) OR
        (receipt_id IS NOT NULL AND booking_id IS NOT NULL) OR
        (transaction_id IS NOT NULL AND booking_id IS NOT NULL)
    )
);
CREATE INDEX idx_links_receipt ON links(receipt_id);
CREATE INDEX idx_links_transaction ON links(transaction_id);
CREATE INDEX idx_links_booking ON links(booking_id);
Powered by Datasette · Queries took 80.186ms · Data license: Intern · Data source: PayPal CSV + PDF-Belege