Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 5,101–5,125 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 5101 | 5271 | 2 | 2018-02-21 13:05:16 | 1 | Private Vehicle |
| 5102 | 5270 | 2 | 2018-02-21 13:05:23 | 1 | Private Vehicle |
| 5103 | 5260 | 1 | 2018-02-21 16:32:48 | 1 | Metro |
| 5104 | 5259 | 1 | 2018-02-21 16:33:14 | 1 | Metro |
| 5105 | 5268 | 1 | 2018-02-22 10:07:20 | 1 | Walk |
| 5106 | 5269 | 1 | 2018-02-22 10:07:35 | 1 | Walk |
| 5107 | 5306 | 1 | 2018-02-22 11:13:01 | 1 | Walk |
| 5108 | 5313 | 4 | 2018-02-23 12:09:04 | 1 | Taxi |
| 5109 | 5314 | 4 | 2018-02-23 12:09:20 | 1 | Taxi |
| 5110 | 5316 | 4 | 2018-02-24 10:53:00 | 1 | Bus |
| 5111 | 5317 | 4 | 2018-02-24 10:53:01 | 1 | Bus |
| 5112 | 5318 | 2 | 2018-02-24 10:54:52 | 1 | Walk |
| 5113 | 5289 | 1 | 2018-02-24 11:18:49 | 1 | Bus |
| 5114 | 5290 | 1 | 2018-02-24 11:19:04 | 1 | Bus |
| 5115 | 5319 | 1 | 2018-02-24 11:33:11 | 1 | Walk |
| 5116 | 5320 | 1 | 2018-02-24 11:33:13 | 1 | Walk |
| 5117 | 5320 | 1 | 2018-02-24 14:29:13 | 0 | NULL |
| 5118 | 5319 | 1 | 2018-02-24 15:02:46 | 0 | NULL |
| 5119 | 5321 | 1 | 2018-02-25 09:13:31 | 1 | Private Vehicle |
| 5120 | 5237 | 4 | 2018-02-25 09:59:36 | 1 | Metro |
| 5121 | 5299 | 1 | 2018-02-25 11:26:03 | 1 | Metro |
| 5122 | 5323 | 4 | 2018-02-25 11:48:25 | 1 | Metro |
| 5123 | 5325 | 4 | 2018-02-25 11:48:31 | 1 | Metro |
| 5124 | 5322 | 4 | 2018-02-25 11:48:36 | 1 | Metro |
| 5125 | 5324 | 4 | 2018-02-25 11:48:40 | 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;