Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 1,176–1,200 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 1176 | 1125 | 4 | 2015-10-13 13:22:43 | 1 | Bus |
| 1177 | 1115 | 4 | 2015-10-13 13:23:23 | 1 | Bus |
| 1178 | 1116 | 4 | 2015-10-13 13:24:26 | 1 | Bus |
| 1179 | 1120 | 4 | 2015-10-13 13:25:26 | 1 | Bus |
| 1180 | 1123 | 4 | 2015-10-13 13:26:11 | 1 | Bus |
| 1181 | 1316 | 1 | 2015-10-13 13:27:27 | 1 | Metro |
| 1182 | 1315 | 1 | 2015-10-13 13:27:38 | 1 | Metro |
| 1183 | 1317 | 4 | 2015-10-14 11:43:32 | 1 | Bus |
| 1184 | 1319 | 4 | 2015-10-14 11:43:32 | 1 | Bus |
| 1185 | 1318 | 4 | 2015-10-14 11:44:00 | 1 | Bus |
| 1186 | 1324 | 1 | 2015-10-15 09:40:12 | 1 | Walk |
| 1187 | 1325 | 2 | 2015-10-15 12:07:00 | 1 | Metro |
| 1188 | 1327 | 2 | 2015-10-16 11:07:29 | 1 | Metro |
| 1189 | 1326 | 2 | 2015-10-16 11:07:58 | 1 | Metro |
| 1190 | 1321 | 3 | 2015-10-16 12:43:20 | 1 | Metro |
| 1191 | 1320 | 3 | 2015-10-16 12:43:21 | 1 | Metro |
| 1192 | 1295 | 1 | 2015-10-17 11:38:52 | 1 | Train |
| 1193 | 1296 | 1 | 2015-10-17 11:39:23 | 1 | Train |
| 1194 | 1331 | 2 | 2015-10-18 11:02:00 | 1 | Taxi |
| 1195 | 1333 | 2 | 2015-10-18 13:44:34 | 1 | Metro |
| 1196 | 1332 | 2 | 2015-10-18 13:44:35 | 1 | Metro |
| 1197 | 1334 | 2 | 2015-10-18 13:45:14 | 1 | Metro |
| 1198 | 1335 | 2 | 2015-10-18 13:45:14 | 1 | Metro |
| 1199 | 1335 | 2 | 2015-10-18 16:28:12 | 0 | NULL |
| 1200 | 1332 | 2 | 2015-10-18 16:35:58 | 0 | NULL |
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;