summaryrefslogtreecommitdiff
path: root/import
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2020-03-31 12:36:13 +0200
committeremkael <emkael@tlen.pl>2020-03-31 12:36:13 +0200
commit0027916f526004aa52f72051a70f9f696a097ab9 (patch)
tree6b8b5f497d36b1f3bd795703ed8d382de79cd0ce /import
parent6f16e4f57867897a5ae62bde1fde813626756cee (diff)
Phantom WC standings removed pre-foreign keys
Diffstat (limited to 'import')
-rw-r--r--import/01a_integrity_fixes.sql3
1 files changed, 3 insertions, 0 deletions
diff --git a/import/01a_integrity_fixes.sql b/import/01a_integrity_fixes.sql
index 559a576..1a57c1e 100644
--- a/import/01a_integrity_fixes.sql
+++ b/import/01a_integrity_fixes.sql
@@ -1,3 +1,6 @@
UPDATE qualifying SET q1 = NULL WHERE q1 = '';
UPDATE qualifying SET q2 = NULL WHERE q2 = '';
UPDATE qualifying SET q3 = NULL WHERE q3 = '';
+
+DELETE FROM constructorStandings WHERE raceId NOT IN (SELECT raceId FROM races);
+DELETE FROM driverStandings WHERE raceId NOT IN (SELECT raceId FROM races);