Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 4,376–4,400 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 4376 | 4570 | 4 | 2017-09-11 16:09:11 | 1 | Private Vehicle |
| 4377 | 4530 | 1 | 2017-09-13 10:19:54 | 1 | Metro |
| 4378 | 4528 | 1 | 2017-09-13 10:20:09 | 1 | Metro |
| 4379 | 4529 | 1 | 2017-09-13 10:20:19 | 1 | Metro |
| 4380 | 4527 | 1 | 2017-09-13 10:20:22 | 1 | Metro |
| 4381 | 4581 | 2 | 2017-09-13 10:34:56 | 1 | Private Vehicle |
| 4382 | 4584 | 2 | 2017-09-13 10:35:06 | 1 | Private Vehicle |
| 4383 | 4582 | 2 | 2017-09-13 10:35:10 | 1 | Private Vehicle |
| 4384 | 4583 | 2 | 2017-09-13 10:35:23 | 1 | Private Vehicle |
| 4385 | 4585 | 2 | 2017-09-13 10:35:37 | 1 | Private Vehicle |
| 4386 | 4586 | 2 | 2017-09-13 16:57:25 | 1 | Metro |
| 4387 | 4587 | 2 | 2017-09-13 16:57:56 | 1 | Metro |
| 4388 | 4589 | 2 | 2017-09-15 10:16:34 | 1 | Private Vehicle |
| 4389 | 4588 | 2 | 2017-09-15 10:16:47 | 1 | Private Vehicle |
| 4390 | 4556 | 1 | 2017-09-15 14:18:19 | 1 | Walk |
| 4391 | 4554 | 1 | 2017-09-15 14:18:33 | 1 | Walk |
| 4392 | 4558 | 1 | 2017-09-15 14:18:37 | 1 | Walk |
| 4393 | 4555 | 1 | 2017-09-15 14:18:45 | 1 | Walk |
| 4394 | 4557 | 1 | 2017-09-15 14:18:45 | 1 | Walk |
| 4395 | 4578 | 3 | 2017-09-16 10:06:28 | 1 | Metro |
| 4396 | 4580 | 3 | 2017-09-16 10:06:49 | 1 | Metro |
| 4397 | 4577 | 3 | 2017-09-16 10:07:03 | 1 | Metro |
| 4398 | 4579 | 3 | 2017-09-16 10:07:04 | 1 | Metro |
| 4399 | 4638 | 1 | 2017-09-17 10:01:33 | 1 | Metro |
| 4400 | 4637 | 1 | 2017-09-17 10:01:36 | 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;