mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-03-11 18:37:28 -04:00
add an update script to add StateId to Events table
This commit is contained in:
20
db/zm_update-1.30.2.sql
Normal file
20
db/zm_update-1.30.2.sql
Normal file
@@ -0,0 +1,20 @@
|
||||
--
|
||||
-- This updates a 1.30.1 database to 1.30.2
|
||||
--
|
||||
-- Add StateId Column to Events.
|
||||
--
|
||||
|
||||
SET @s = (SELECT IF(
|
||||
(SELECT COUNT(*)
|
||||
FROM INFORMATION_SCHEMA.COLUMNS
|
||||
WHERE table_name = 'Events'
|
||||
AND table_schema = DATABASE()
|
||||
AND column_name = 'StateId'
|
||||
) > 0,
|
||||
"SELECT 'Column StateId exists in Events'",
|
||||
"ALTER TABLE Events ADD `StateId` int(10) unsigned default NULL AFTER `Notes`"
|
||||
));
|
||||
|
||||
PREPARE stmt FROM @s;
|
||||
EXECUTE stmt;
|
||||
|
||||
Reference in New Issue
Block a user