From 43968b78620ddda5b12ad40d3277a98bf2e9d22a Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 14 Dec 2015 17:03:45 -0500 Subject: [PATCH] add Storage table creation --- db/zm_update-1.28.110.sql | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/db/zm_update-1.28.110.sql b/db/zm_update-1.28.110.sql index 7f1e4af50..41662d2a4 100644 --- a/db/zm_update-1.28.110.sql +++ b/db/zm_update-1.28.110.sql @@ -1,9 +1,27 @@ -- --- This updates a 1.28.99 database to 1.28.100 +-- This updates a 1.28.109 database to 1.28.110 -- +SET @s = (SELECT IF( + (SELECT COUNT(*) + FROM INFORMATION_SCHEMA.TABLES + WHERE table_name = 'Storage' + AND table_schema = DATABASE() + ) > 0, +"SELECT 'Storage table exists'", +"CREATE TABLE `Storage` ( + `Id` smallint(5) unsigned NOT NULL auto_increment, + `Path` varchar(64) NOT NULL default '', + `Name` varchar(64) NOT NULL default '', + PRIMARY KEY (`Id`) +)" +)); + +PREPARE stmt FROM @s; +EXECUTE stmt; + -- --- Add ServerId column to Monitors +-- Add StorageId column to Monitors -- SET @s = (SELECT IF(