From 21b3bf3aa44eb243ee540c0f4b096ae2c8cb8cdf Mon Sep 17 00:00:00 2001 From: dtookey Date: Wed, 20 Apr 2022 10:51:31 -0400 Subject: [PATCH] removed begin/end block that was throwing errors --- src/sql/0-run-first/1-sanitize_init.sql | 14 +++++++++----- src/sql/0-run-first/contributions.sql | 6 ++---- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/sql/0-run-first/1-sanitize_init.sql b/src/sql/0-run-first/1-sanitize_init.sql index ecb0948..194bfe3 100644 --- a/src/sql/0-run-first/1-sanitize_init.sql +++ b/src/sql/0-run-first/1-sanitize_init.sql @@ -14,15 +14,19 @@ DELETE FROM project_lifecycle WHERE project_number = 'EVENT'; + +#for some reason, Datastudio won't let us change the timezone, so it reports everything in UTC. This is the current workaround +SET @tz_adjust = 4; + UPDATE billing -set accepted_date = accepted_date - INTERVAL 4 HOUR, - line_created = line_created - INTERVAL 4 HOUR; +SET accepted_date = accepted_date - INTERVAL @tz_adjust HOUR, + line_created = line_created - INTERVAL @tz_adjust HOUR; UPDATE dispatch -SET date_dispatched = date_dispatched - INTERVAL 4 HOUR; +SET date_dispatched = date_dispatched - INTERVAL @tz_adjust HOUR; UPDATE project_comments -set timestamp = timestamp - INTERVAL 4 HOUR; +set timestamp = timestamp - INTERVAL @tz_adjust HOUR; UPDATE project_lifecycle -SET timestamp = timestamp - INTERVAL 4 HOUR; +SET timestamp = timestamp - INTERVAL @tz_adjust HOUR; ALTER TABLE project_lifecycle ADD COLUMN id INT AUTO_INCREMENT KEY FIRST; diff --git a/src/sql/0-run-first/contributions.sql b/src/sql/0-run-first/contributions.sql index 40d62db..143344a 100644 --- a/src/sql/0-run-first/contributions.sql +++ b/src/sql/0-run-first/contributions.sql @@ -42,7 +42,7 @@ ALTER TABLE engineer_contributions #########################Soil Contributions############################################################################# DROP TABLE IF EXISTS rdu_soil_contributions; -BEGIN + CREATE TABLE rdu_soil_contributions AS SELECT CONCAT(users.lname, ', ', users.fname) AS `Engineer`, @@ -78,6 +78,4 @@ WHERE id IN (SELECT bad_rows.id AND good_rows.min_id <> bad_rows.id); ALTER TABLE rdu_soil_contributions - DROP COLUMN IF EXISTS id; - -END \ No newline at end of file + DROP COLUMN IF EXISTS id; \ No newline at end of file