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,801–4,825 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 4801 | 4879 | 2 | 2017-11-25 16:39:02 | 1 | Metro |
| 4802 | 4880 | 2 | 2017-11-25 16:39:17 | 1 | Metro |
| 4803 | 4894 | 1 | 2017-11-26 10:35:15 | 1 | Metro |
| 4804 | 4893 | 1 | 2017-11-26 10:35:22 | 1 | Metro |
| 4805 | 4896 | 4 | 2017-11-26 14:28:35 | 1 | Private Vehicle |
| 4806 | 4895 | 4 | 2017-11-26 14:28:39 | 1 | Private Vehicle |
| 4807 | 4897 | 5 | 2017-11-26 15:48:39 | 1 | Walk |
| 4808 | 4895 | 4 | 2017-11-26 16:27:21 | 0 | NULL |
| 4809 | 4898 | 1 | 2017-11-28 12:20:40 | 1 | Private Vehicle |
| 4810 | 4899 | 1 | 2017-11-28 12:21:01 | 1 | Private Vehicle |
| 4811 | 4900 | 2 | 2017-11-28 14:18:58 | 1 | Metro |
| 4812 | 4901 | 2 | 2017-11-29 13:26:02 | 1 | Metro |
| 4813 | 4902 | 1 | 2017-12-01 11:51:22 | 1 | Metro |
| 4814 | 4903 | 1 | 2017-12-01 11:51:32 | 1 | Metro |
| 4815 | 4904 | 1 | 2017-12-01 11:51:39 | 1 | Metro |
| 4816 | 4905 | 1 | 2017-12-01 11:51:57 | 1 | Metro |
| 4817 | 4907 | 2 | 2017-12-01 12:09:05 | 1 | Walk |
| 4818 | 4910 | 2 | 2017-12-01 12:09:18 | 1 | Walk |
| 4819 | 4909 | 2 | 2017-12-01 12:09:36 | 1 | Walk |
| 4820 | 4908 | 2 | 2017-12-01 12:09:54 | 1 | Walk |
| 4821 | 4838 | 1 | 2017-12-04 10:55:19 | 1 | Metro |
| 4822 | 4837 | 1 | 2017-12-04 10:55:24 | 1 | Metro |
| 4823 | 4912 | 1 | 2017-12-06 11:21:02 | 1 | Other |
| 4824 | 4913 | 1 | 2017-12-06 11:21:31 | 1 | Other |
| 4825 | 4919 | 1 | 2017-12-07 09:17:20 | 1 | Walk |
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;