add the update to add Type to Storage

This commit is contained in:
Isaac Connor 2017-10-12 07:50:43 -07:00
parent 8abb8a9259
commit b96b2636bb
2 changed files with 26 additions and 9 deletions

17
db/zm_update-1.31.9.sql Normal file
View File

@ -0,0 +1,17 @@
--
-- Add Type column to Storage
--
SET @s = (SELECT IF(
(SELECT COUNT(*)
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_name = 'Storage'
AND table_schema = DATABASE()
AND column_name = 'Type'
) > 0,
"SELECT 'Column Type already exists in Storages'",
"ALTER TABLE Storage ADD `Type` enum('local','s3fs') NOT NULL default 'local' AFTER `Name`"
));
PREPARE stmt FROM @s;
EXECUTE stmt;