add ServerId to Storage
This commit is contained in:
parent
0d7fff761c
commit
0c350b8f41
|
@ -640,6 +640,7 @@ CREATE TABLE `Storage` (
|
|||
`Type` enum('local','s3fs') NOT NULL default 'local',
|
||||
`DiskSpace` bigint unsigned default NULL,
|
||||
`Scheme enum('Deep','Medium','Shallow') NOT NULL default 'Medium',
|
||||
`ServerId` int(10) unsigned,
|
||||
PRIMARY KEY (`Id`)
|
||||
) ENGINE=@ZM_MYSQL_ENGINE@;
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
SET @s = (SELECT IF(
|
||||
(SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS WHERE table_schema = DATABASE()
|
||||
AND table_name = 'Storage'
|
||||
AND column_name = 'ServerId'
|
||||
) > 0,
|
||||
"SELECT 'Column ServerId already exists in Storage'",
|
||||
"ALTER TABLE Storage ADD `ServerId` int(10) unsigned AFTER `Scheme`"
|
||||
));
|
||||
|
||||
PREPARE stmt FROM @s;
|
||||
EXECUTE stmt;
|
Loading…
Reference in New Issue