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,576–4,600 of 9,738
| scan_idINTEGER | ticket_id→ ticket.ticket_id | entrance_id→ entrance.entrance_id | scanned_atTEXT | is_first_entryINTEGER | transport_modeTEXT |
|---|---|---|---|---|---|
| 4576 | 4777 | 5 | 2017-10-17 16:24:16 | 1 | Metro |
| 4577 | 4779 | 5 | 2017-10-17 16:24:20 | 1 | Metro |
| 4578 | 4783 | 2 | 2017-10-18 14:49:40 | 1 | Metro |
| 4579 | 4782 | 2 | 2017-10-18 14:49:59 | 1 | Metro |
| 4580 | 4784 | 2 | 2017-10-18 14:50:03 | 1 | Metro |
| 4581 | 4796 | 1 | 2017-10-20 09:12:42 | 1 | Walk |
| 4582 | 4795 | 1 | 2017-10-20 09:12:49 | 1 | Walk |
| 4583 | 4795 | 1 | 2017-10-20 11:30:24 | 0 | NULL |
| 4584 | 4796 | 1 | 2017-10-20 11:55:54 | 0 | NULL |
| 4585 | 4745 | 2 | 2017-10-20 16:03:53 | 1 | Metro |
| 4586 | 4799 | 4 | 2017-10-21 09:15:45 | 1 | Private Vehicle |
| 4587 | 4774 | 1 | 2017-10-21 09:26:01 | 1 | Metro |
| 4588 | 4804 | 2 | 2017-10-21 14:37:32 | 1 | Private Vehicle |
| 4589 | 4806 | 2 | 2017-10-21 14:37:39 | 1 | Private Vehicle |
| 4590 | 4805 | 2 | 2017-10-21 14:37:47 | 1 | Private Vehicle |
| 4591 | 4794 | 1 | 2017-10-22 11:30:15 | 1 | Bus |
| 4592 | 4801 | 4 | 2017-10-23 11:31:39 | 1 | Walk |
| 4593 | 4802 | 4 | 2017-10-23 11:31:43 | 1 | Walk |
| 4594 | 4803 | 4 | 2017-10-23 11:31:54 | 1 | Walk |
| 4595 | 4751 | 1 | 2017-10-23 13:05:40 | 1 | Walk |
| 4596 | 4809 | 1 | 2017-10-23 14:10:27 | 1 | Train |
| 4597 | 4767 | 3 | 2017-10-25 10:01:03 | 1 | Train |
| 4598 | 4768 | 3 | 2017-10-25 10:01:10 | 1 | Train |
| 4599 | 4814 | 4 | 2017-10-26 10:16:47 | 1 | Metro |
| 4600 | 4104 | 1 | 2017-10-26 12:26:52 | 1 | Bus |
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;