Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 6,326–6,350 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 6326 | 5846 | 4 | 2018-08-29 13:46:11 | 1 | Bus |
| 6327 | 5851 | 4 | 2018-08-29 13:46:19 | 1 | Bus |
| 6328 | 5845 | 4 | 2018-08-29 13:46:28 | 1 | Bus |
| 6329 | 5843 | 4 | 2018-08-29 13:46:32 | 1 | Bus |
| 6330 | 5840 | 4 | 2018-08-29 13:46:41 | 1 | Bus |
| 6331 | 5849 | 4 | 2018-08-29 13:46:41 | 1 | Bus |
| 6332 | 5850 | 4 | 2018-08-29 13:46:47 | 1 | Bus |
| 6333 | 5848 | 4 | 2018-08-29 13:46:49 | 1 | Bus |
| 6334 | 5854 | 4 | 2018-08-29 13:46:51 | 1 | Bus |
| 6335 | 5844 | 4 | 2018-08-29 13:47:01 | 1 | Bus |
| 6336 | 5853 | 4 | 2018-08-29 13:47:05 | 1 | Bus |
| 6337 | 5859 | 4 | 2018-08-29 13:47:16 | 1 | Bus |
| 6338 | 5860 | 4 | 2018-08-29 13:47:21 | 1 | Bus |
| 6339 | 5856 | 4 | 2018-08-29 13:47:23 | 1 | Bus |
| 6340 | 5857 | 4 | 2018-08-29 13:47:29 | 1 | Bus |
| 6341 | 5847 | 4 | 2018-08-29 13:47:34 | 1 | Bus |
| 6342 | 5858 | 4 | 2018-08-29 13:47:59 | 1 | Bus |
| 6343 | 5855 | 4 | 2018-08-29 13:48:20 | 1 | Bus |
| 6344 | 5862 | 4 | 2018-08-29 13:48:27 | 1 | Bus |
| 6345 | 5863 | 4 | 2018-08-29 13:48:34 | 1 | Bus |
| 6346 | 5852 | 4 | 2018-08-29 13:48:47 | 1 | Bus |
| 6347 | 5861 | 4 | 2018-08-29 13:51:29 | 1 | Bus |
| 6348 | 5864 | 4 | 2018-08-29 13:51:41 | 1 | Bus |
| 6349 | 6571 | 1 | 2018-08-30 09:14:07 | 1 | Metro |
| 6350 | 6572 | 1 | 2018-08-30 09:14:27 | 1 | Metro |
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;