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,476–3,500 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 3476 | 3612 | 2 | 2017-03-25 14:54:13 | 1 | Metro |
| 3477 | 3633 | 4 | 2017-03-25 15:19:48 | 1 | Other |
| 3478 | 3632 | 4 | 2017-03-25 15:20:07 | 1 | Other |
| 3479 | 3685 | 1 | 2017-03-27 10:08:36 | 1 | Metro |
| 3480 | 3686 | 1 | 2017-03-27 10:08:49 | 1 | Metro |
| 3481 | 3698 | 1 | 2017-03-28 10:58:53 | 1 | Metro |
| 3482 | 3697 | 1 | 2017-03-28 10:59:06 | 1 | Metro |
| 3483 | 3701 | 1 | 2017-03-28 10:59:07 | 1 | Metro |
| 3484 | 3699 | 1 | 2017-03-28 10:59:08 | 1 | Metro |
| 3485 | 3700 | 1 | 2017-03-28 10:59:11 | 1 | Metro |
| 3486 | 3694 | 2 | 2017-03-28 12:08:00 | 1 | Metro |
| 3487 | 3689 | 2 | 2017-03-29 10:57:57 | 1 | Private Vehicle |
| 3488 | 3702 | 4 | 2017-03-31 12:51:02 | 1 | Walk |
| 3489 | 3707 | 1 | 2017-03-31 13:16:14 | 1 | Metro |
| 3490 | 3704 | 1 | 2017-03-31 13:16:28 | 1 | Metro |
| 3491 | 3705 | 1 | 2017-03-31 13:16:28 | 1 | Metro |
| 3492 | 3703 | 1 | 2017-03-31 13:16:30 | 1 | Metro |
| 3493 | 3706 | 1 | 2017-03-31 13:16:36 | 1 | Metro |
| 3494 | 3702 | 4 | 2017-03-31 15:38:41 | 0 | NULL |
| 3495 | 3711 | 2 | 2017-03-31 16:09:34 | 1 | Metro |
| 3496 | 3713 | 2 | 2017-04-01 13:06:55 | 1 | Walk |
| 3497 | 3712 | 2 | 2017-04-01 13:06:57 | 1 | Walk |
| 3498 | 3695 | 1 | 2017-04-04 10:56:07 | 1 | Metro |
| 3499 | 3696 | 1 | 2017-04-04 10:56:08 | 1 | Metro |
| 3500 | 3709 | 3 | 2017-04-04 13:44:05 | 1 | Bus |
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;