Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 3,526–3,550 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 3526 | 3214 | 1 | 2017-04-06 13:18:18 | 1 | Bus |
| 3527 | 3226 | 1 | 2017-04-06 13:18:19 | 1 | Bus |
| 3528 | 3201 | 1 | 2017-04-06 13:18:24 | 1 | Bus |
| 3529 | 3207 | 1 | 2017-04-06 13:18:30 | 1 | Bus |
| 3530 | 3220 | 1 | 2017-04-06 13:18:42 | 1 | Bus |
| 3531 | 3229 | 1 | 2017-04-06 13:19:06 | 1 | Bus |
| 3532 | 3208 | 1 | 2017-04-06 13:19:24 | 1 | Bus |
| 3533 | 3234 | 1 | 2017-04-06 13:19:24 | 1 | Bus |
| 3534 | 3224 | 1 | 2017-04-06 13:19:30 | 1 | Bus |
| 3535 | 3225 | 1 | 2017-04-06 13:19:38 | 1 | Bus |
| 3536 | 3211 | 1 | 2017-04-06 13:19:54 | 1 | Bus |
| 3537 | 3215 | 1 | 2017-04-06 13:20:01 | 1 | Bus |
| 3538 | 3222 | 1 | 2017-04-06 13:20:04 | 1 | Bus |
| 3539 | 3219 | 1 | 2017-04-06 13:20:07 | 1 | Bus |
| 3540 | 3212 | 1 | 2017-04-06 13:20:09 | 1 | Bus |
| 3541 | 3216 | 1 | 2017-04-06 13:20:14 | 1 | Bus |
| 3542 | 3217 | 1 | 2017-04-06 13:20:27 | 1 | Bus |
| 3543 | 3227 | 1 | 2017-04-06 13:21:54 | 1 | Bus |
| 3544 | 3238 | 1 | 2017-04-06 13:21:54 | 1 | Bus |
| 3545 | 3230 | 1 | 2017-04-06 13:21:57 | 1 | Bus |
| 3546 | 3228 | 1 | 2017-04-06 13:23:08 | 1 | Bus |
| 3547 | 3231 | 1 | 2017-04-06 13:24:24 | 1 | Bus |
| 3548 | 3728 | 2 | 2017-04-07 14:54:38 | 1 | Metro |
| 3549 | 3729 | 2 | 2017-04-07 14:54:42 | 1 | Metro |
| 3550 | 3731 | 2 | 2017-04-08 10:23:38 | 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;