Update SQL 1.2 to 1.3

Update SQL 1.2 to 1.3
This commit is contained in:
cp6 2021-01-31 00:24:07 +11:00
parent cf353906e7
commit cb7f87edc5
2 changed files with 2 additions and 31 deletions

View File

@ -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`;

2
update1.2to1.3.sql Normal file
View File

@ -0,0 +1,2 @@
ALTER TABLE `servers`
ADD COLUMN `label` VARCHAR(24) NULL DEFAULT NULL AFTER `hostname`;