move to 1 table instead of 3 (what was I thinking???)

This commit is contained in:
41666 2023-05-31 01:01:17 -04:00
parent 11127f269d
commit e5c57bf505
7 changed files with 41 additions and 285 deletions

View file

@ -16,7 +16,7 @@ impl Class {
let pool = ctx.data::<Pool<Postgres>>().unwrap();
let sql = format!(
"SELECT count(distinct character_id) FROM classes WHERE time > now() - interval '15 minutes' AND class_id = $1 {};",
"SELECT count(distinct character_id) FROM players WHERE time > now() - interval '15 minutes' AND class_id = $1 {};",
filters.sql(),
);

View file

@ -16,7 +16,7 @@ impl Vehicle {
let pool = ctx.data::<Pool<Postgres>>().unwrap();
let sql = format!(
"SELECT count(distinct character_id) FROM vehicles WHERE time > now() - interval '15 minutes' AND vehicle_id = $1 {};",
"SELECT count(distinct character_id) FROM players WHERE time > now() - interval '15 minutes' AND vehicle_id = $1 {};",
filters.sql(),
);
@ -89,7 +89,7 @@ impl Vehicles {
let pool = ctx.data::<Pool<Postgres>>().unwrap();
let sql = format!(
"SELECT count(distinct character_id) FROM vehicles WHERE time > now() - interval '15 minutes' {};",
"SELECT count(distinct character_id) FROM players WHERE time > now() - interval '15 minutes' AND vehicle_id != 'unknown' {};",
self.filters.sql(),
);