Revert "cleaned up 1-sanitize_init.sql"

This reverts commit 8c011587
master
dtookey 4 years ago
parent 8c0115871b
commit 48dc463cd4

@ -1,9 +1,8 @@
# Table removal
DROP TABLE IF EXISTS tokens;
# Column changes
-- noinspection SqlWithoutWhere
CREATE OR REPLACE INDEX billing_refnum ON billing (refNumber);
-- noinspection SqlWithoutWhere
UPDATE users
SET hash = '';
@ -11,37 +10,26 @@ UPDATE project_lifecycle
SET new_value = '+CREATED',
changed_column = 'status'
WHERE changed_column = 'created';
# Column deletions
DELETE
FROM project_lifecycle
WHERE project_number = 'EVENT';
# TZ ADJUSTMENT
# for some reason, Datastudio won't let us change the timezone, so it reports everything in UTC. This is the current workaround
#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 @tz_adjust HOUR,
line_created = line_created - INTERVAL @tz_adjust HOUR;
UPDATE dispatch
SET date_dispatched = date_dispatched - INTERVAL @tz_adjust HOUR;
UPDATE project_comments
SET timestamp = timestamp - INTERVAL @tz_adjust HOUR;
set timestamp = timestamp - INTERVAL @tz_adjust HOUR;
UPDATE project_lifecycle
SET timestamp = timestamp - INTERVAL @tz_adjust HOUR;
# ADDING ID COLUMNS
ALTER TABLE project_lifecycle
ADD COLUMN id INT AUTO_INCREMENT KEY FIRST;
# INDEXES
CREATE OR REPLACE INDEX billing_refnum ON billing (refNumber);
CREATE OR REPLACE INDEX lifecycle_timestamp on project_lifecycle (timestamp);
CREATE OR REPLACE INDEX lifecycle_newval on project_lifecycle (new_value);

Loading…
Cancel
Save