dorodere / komplett-normale-busliste

Registration system for bus drives, likely not of interest
GNU Affero General Public License v3.0
0 stars 0 forks source link

Deletions of drives + persons somehow don't propagate to registrations #25

Open dorodere opened 1 year ago

dorodere commented 1 year ago

Snapshot of local testing setup:

sqlite> .tables
drive         person        registration  settings
sqlite> select * from registration
   ...> ;
┌────┬───────────┬──────────┬────────────┐
│ id │ person_id │ drive_id │ registered │
├────┼───────────┼──────────┼────────────┤
│ 1  │ 1         │ 4        │ 0          │
│ 2  │ 1         │ 3        │ 1          │
│ 6  │ 1         │ 6        │ 0          │
│ 10 │ 1         │ 8        │ 1          │
│ 13 │ 1         │ 7        │ 1          │
│ 28 │ 2         │ 7        │ 1          │
│ 29 │ 2         │ 8        │ 1          │
│ 53 │ 1         │ 9        │ 1          │
│ 63 │ 2         │ 9        │ 0          │
│ 65 │ 3         │ 8        │ 1          │
│ 66 │ 3         │ 9        │ 1          │
│ 67 │ 1         │ 10       │ 1          │
│ 72 │ 1         │ 12       │ 0          │
└────┴───────────┴──────────┴────────────┘
sqlite> select * from drive;
┌──────────┬────────────┬─────────────────────┬──────────────────┐
│ drive_id │ drivedate  │      deadline       │ registration_cap │
├──────────┼────────────┼─────────────────────┼──────────────────┤
│ 10       │ 2022-11-27 │ 2022-11-28 23:00:00 │                  │
│ 11       │ 2022-12-04 │ 2022-11-30 23:00:00 │ 3                │
└──────────┴────────────┴─────────────────────┴──────────────────┘
sqlite> select * from person;
┌───────────┬─────────┬──────┬──────────────────────┬───────┬──────────────────┬──────────────┬────────────┐
│ person_id │ prename │ name │        email         │ token │ token_expiration │ is_superuser │ is_visible │
├───────────┼─────────┼──────┼──────────────────────┼───────┼──────────────────┼──────────────┼────────────┤
│ 1         │ John    │ Doe  │ john_doe@example.com │       │                  │ 1            │ 1          │
│ 2         │ doge    │ yes  │ kindof@sus           │       │                  │ 0            │ 1          │
└───────────┴─────────┴──────┴──────────────────────┴───────┴──────────────────┴──────────────┴────────────┘

This could mean that we end up with already existent registrations for some reason when creating a new drive or person, should we run out of IDs.