From cb7f87edc53aa707604e94b472a246aede55e271 Mon Sep 17 00:00:00 2001 From: cp6 Date: Sun, 31 Jan 2021 00:24:07 +1100 Subject: [PATCH] Update SQL 1.2 to 1.3 Update SQL 1.2 to 1.3 --- update.sql | 31 ------------------------------- update1.2to1.3.sql | 2 ++ 2 files changed, 2 insertions(+), 31 deletions(-) delete mode 100644 update.sql create mode 100644 update1.2to1.3.sql diff --git a/update.sql b/update.sql deleted file mode 100644 index ad8b414..0000000 --- a/update.sql +++ /dev/null @@ -1,31 +0,0 @@ -ALTER TABLE `disk_speed` - ADD COLUMN `datetime` DATETIME NULL DEFAULT CURRENT_TIMESTAMP AFTER `1m_as_mbps`; - -ALTER TABLE `servers` - ADD COLUMN `ssh_port` INT(11) NULL DEFAULT '22' AFTER `os`; - -ALTER TABLE `servers` - ADD COLUMN `notes` VARCHAR(255) NULL DEFAULT NULL AFTER `tags`; - -ALTER TABLE `disk_speed` - DROP PRIMARY KEY; - -ALTER TABLE `disk_speed` - ADD UNIQUE INDEX `Index 1` (`server_id`, `datetime`); - -ALTER TABLE `servers` - ADD COLUMN `has_st` TINYINT(1) NULL DEFAULT '0' AFTER `has_yabs`; - -UPDATE servers t1 - JOIN - ( - SELECT server_id - FROM speed_tests - GROUP BY server_id - HAVING COUNT(*) > 0 - ) t2 - ON t1.id = t2.server_id -SET t1.has_st = 1; - -ALTER TABLE `servers` - CHANGE COLUMN `bandwidth` `bandwidth` FLOAT NULL DEFAULT NULL AFTER `disk_type`; \ No newline at end of file diff --git a/update1.2to1.3.sql b/update1.2to1.3.sql new file mode 100644 index 0000000..4f2d849 --- /dev/null +++ b/update1.2to1.3.sql @@ -0,0 +1,2 @@ +ALTER TABLE `servers` + ADD COLUMN `label` VARCHAR(24) NULL DEFAULT NULL AFTER `hostname`; \ No newline at end of file