Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 9,726–9,738 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 9726 | 9826 | 1 | 2020-02-23 14:42:42 | 1 | Other |
| 9727 | 9825 | 1 | 2020-02-23 14:42:45 | 1 | Other |
| 9728 | 9809 | 1 | 2020-02-24 11:56:41 | 1 | Bus |
| 9729 | 9810 | 1 | 2020-02-24 11:56:42 | 1 | Bus |
| 9730 | 9808 | 1 | 2020-02-24 11:56:55 | 1 | Bus |
| 9731 | 9807 | 1 | 2020-02-24 11:57:11 | 1 | Bus |
| 9732 | 9834 | 2 | 2020-02-24 15:48:21 | 1 | Metro |
| 9733 | 9833 | 2 | 2020-02-24 15:48:27 | 1 | Metro |
| 9734 | 9835 | 2 | 2020-02-24 15:48:27 | 1 | Metro |
| 9735 | 9837 | 4 | 2020-02-27 14:34:55 | 1 | Walk |
| 9736 | 9836 | 1 | 2020-02-29 09:44:20 | 1 | Walk |
| 9737 | 9838 | 1 | 2020-02-29 11:05:01 | 1 | Walk |
| 9738 | 9839 | 1 | 2020-02-29 11:05:34 | 1 | Walk |
Table definition
CREATE TABLE entry_scan (
scan_id INTEGER PRIMARY KEY,
ticket_id INTEGER NOT NULL REFERENCES ticket (ticket_id),
entrance_id INTEGER NOT NULL REFERENCES entrance (entrance_id),
scanned_at TEXT NOT NULL,
is_first_entry INTEGER NOT NULL CHECK (is_first_entry IN (0, 1)),
transport_mode TEXT CHECK (transport_mode IN ('Walk', 'Metro', 'Train', 'Bus', 'Taxi', 'Private Vehicle', 'Other')),
CHECK ((is_first_entry = 1) = (transport_mode IS NOT NULL))
) STRICT;