From da8c51b97eeb4a011646d470c3797a608782d512 Mon Sep 17 00:00:00 2001
From: emkael <emkael@tlen.pl>
Date: Thu, 19 Feb 2015 09:18:35 +0100
Subject:  * forcing view recreation

---
 views/full_season_drivers.sql | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'views/full_season_drivers.sql')

diff --git a/views/full_season_drivers.sql b/views/full_season_drivers.sql
index ae36cc8..0ad0bbd 100644
--- a/views/full_season_drivers.sql
+++ b/views/full_season_drivers.sql
@@ -1,11 +1,13 @@
 -- view holds distinct driver-race entries
 -- (eliminating duplicate race entries from shared drives)
+DROP VIEW IF EXISTS driver_races;
 CREATE VIEW driver_races AS
    SELECT driverId, raceId
    FROM results
    GROUP BY driverId, raceId;
 
 -- view aggregates races by season for each driver
+DROP VIEW IF EXISTS driver_season_races;
 CREATE VIEW driver_season_races AS
    SELECT driver_races.driverId, races.year,
       GROUP_CONCAT(driver_races.raceId
@@ -16,12 +18,14 @@ CREATE VIEW driver_season_races AS
    GROUP BY driver_races.driverId, races.year;
 
 -- view aggregates races by season
+DROP VIEW IF EXISTS season_races;
 CREATE VIEW season_races AS
    SELECT year, GROUP_CONCAT(raceId ORDER BY raceId ASC) AS races
    FROM races
    GROUP BY year;
 
 -- selecting only driver-season pairs with all races in a season
+DROP VIEW IF EXISTS full_season_drivers;
 CREATE VIEW full_season_drivers AS
    SELECT driver_season_races.driverId, driver_season_races.year
    FROM season_races
-- 
cgit v1.2.3

