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,401–4,425 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 4401 | 4640 | 3 | 2017-09-17 12:23:04 | 1 | Metro |
| 4402 | 4642 | 3 | 2017-09-17 12:23:29 | 1 | Metro |
| 4403 | 4643 | 3 | 2017-09-17 12:23:30 | 1 | Metro |
| 4404 | 4639 | 3 | 2017-09-17 12:23:36 | 1 | Metro |
| 4405 | 4641 | 3 | 2017-09-17 12:23:38 | 1 | Metro |
| 4406 | 4566 | 2 | 2017-09-18 15:07:56 | 1 | Metro |
| 4407 | 4565 | 2 | 2017-09-18 15:08:20 | 1 | Metro |
| 4408 | 4645 | 1 | 2017-09-19 14:26:05 | 1 | Bus |
| 4409 | 4644 | 1 | 2017-09-19 14:26:06 | 1 | Bus |
| 4410 | 4646 | 1 | 2017-09-19 14:26:15 | 1 | Bus |
| 4411 | 4649 | 2 | 2017-09-20 09:58:02 | 1 | Walk |
| 4412 | 4650 | 2 | 2017-09-20 09:58:45 | 1 | Walk |
| 4413 | 4196 | 1 | 2017-09-20 12:32:49 | 1 | Other |
| 4414 | 4197 | 1 | 2017-09-20 12:33:04 | 1 | Other |
| 4415 | 4198 | 1 | 2017-09-20 12:33:05 | 1 | Other |
| 4416 | 4200 | 1 | 2017-09-20 12:33:13 | 1 | Other |
| 4417 | 4199 | 1 | 2017-09-20 12:33:19 | 1 | Other |
| 4418 | 4203 | 1 | 2017-09-20 12:33:24 | 1 | Other |
| 4419 | 4205 | 1 | 2017-09-20 12:33:25 | 1 | Other |
| 4420 | 4202 | 1 | 2017-09-20 12:33:37 | 1 | Other |
| 4421 | 4209 | 1 | 2017-09-20 12:33:41 | 1 | Other |
| 4422 | 4201 | 1 | 2017-09-20 12:33:49 | 1 | Other |
| 4423 | 4204 | 1 | 2017-09-20 12:34:01 | 1 | Other |
| 4424 | 4212 | 1 | 2017-09-20 12:34:09 | 1 | Other |
| 4425 | 4223 | 1 | 2017-09-20 12:34:37 | 1 | Other |
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;