Table
entry_scan
Every entrance scan; only the first of the day records how the visitor travelled.
Replaces in 2020: Entrance, Ticket.Transportation
Rows 3,901–3,925 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 3901 | 3788 | 4 | 2017-06-14 12:14:34 | 1 | Bus |
| 3902 | 3791 | 4 | 2017-06-14 12:14:37 | 1 | Bus |
| 3903 | 3795 | 4 | 2017-06-14 12:14:42 | 1 | Bus |
| 3904 | 3790 | 4 | 2017-06-14 12:14:59 | 1 | Bus |
| 3905 | 3804 | 4 | 2017-06-14 12:14:59 | 1 | Bus |
| 3906 | 3793 | 4 | 2017-06-14 12:15:07 | 1 | Bus |
| 3907 | 3801 | 4 | 2017-06-14 12:15:13 | 1 | Bus |
| 3908 | 3799 | 4 | 2017-06-14 12:15:27 | 1 | Bus |
| 3909 | 3811 | 4 | 2017-06-14 12:15:37 | 1 | Bus |
| 3910 | 3803 | 4 | 2017-06-14 12:15:43 | 1 | Bus |
| 3911 | 3798 | 4 | 2017-06-14 12:15:46 | 1 | Bus |
| 3912 | 3796 | 4 | 2017-06-14 12:16:07 | 1 | Bus |
| 3913 | 3808 | 4 | 2017-06-14 12:16:31 | 1 | Bus |
| 3914 | 3806 | 4 | 2017-06-14 12:16:41 | 1 | Bus |
| 3915 | 3807 | 4 | 2017-06-14 12:17:07 | 1 | Bus |
| 3916 | 3810 | 4 | 2017-06-14 12:17:31 | 1 | Bus |
| 3917 | 3960 | 4 | 2017-06-14 14:10:22 | 0 | NULL |
| 3918 | 3961 | 1 | 2017-06-14 14:30:41 | 0 | NULL |
| 3919 | 3995 | 2 | 2017-06-15 12:27:19 | 1 | Bus |
| 3920 | 3998 | 2 | 2017-06-15 12:27:23 | 1 | Bus |
| 3921 | 3996 | 2 | 2017-06-15 12:27:32 | 1 | Bus |
| 3922 | 3997 | 2 | 2017-06-15 12:27:34 | 1 | Bus |
| 3923 | 3994 | 2 | 2017-06-15 12:28:07 | 1 | Bus |
| 3924 | 3927 | 1 | 2017-06-16 09:12:58 | 1 | Train |
| 3925 | 3928 | 1 | 2017-06-16 09:13:16 | 1 | Train |
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;