home / bibliothek

loan

0 rows where copy_id = 89

✎ View and edit SQL

This data as json

0 records

CREATE TABLE loan (
  id            INTEGER PRIMARY KEY,
  uuid          TEXT NOT NULL UNIQUE DEFAULT (lower(hex(randomblob(16)))),
  copy_id       INTEGER NOT NULL REFERENCES copy(id),
  person_id     INTEGER NOT NULL REFERENCES person(id),
  direction     TEXT NOT NULL CHECK (direction IN ('out','in')),  -- out = verliehen, in = geliehen
  start_date    TEXT,
  due_date      TEXT,
  returned_date TEXT,
  updated_at    TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now')),
  deleted_at    TEXT
);
CREATE INDEX ix_loan_copy ON loan(copy_id);
Powered by Datasette · Queries took 7.077ms