forked from opendcim/openDCIM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
db-3.2-to-3.3.sql
41 lines (35 loc) · 1.49 KB
/
db-3.2-to-3.3.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
--
-- Allow for alphanumeric names of power connections
--
ALTER TABLE fac_PowerConnection CHANGE PDUPosition PDUPosition VARCHAR(11) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;
--
-- Add Config item for the Work Order Builder and Rack Requests toggles
--
INSERT INTO fac_Config set Parameter='WorkOrderBuilder', Value='disabled', UnitOfMeasure='Enabled/Disabled', ValType='string', DefaultVal='disabled';
INSERT INTO fac_Config set Parameter='RackRequests', Value='enabled', UnitOfMeasure='Enabled/Disabled', ValType='string', DefaultVal='enabled';
--
-- Add mUnits for the temperature sensors
--
ALTER TABLE fac_SensorTemplate ADD COLUMN mUnits ENUM( 'english', 'metric' ) NOT NULL DEFAULT 'english';
--
-- Add dot to fac_Config to handle network map reporting
--
INSERT INTO fac_Config VALUES ('dot', '/usr/bin/dot', 'path', 'string', '/usr/bin/dot');
--
-- Help optimize performance by adding in some indices to existing tables
--
ALTER TABLE fac_PowerDistribution ADD INDEX CabinetID(CabinetID);
ALTER TABLE fac_PowerDistribution ADD INDEX PanelID(PanelID);
ALTER TABLE fac_Device ADD INDEX AssetTag(AssetTag);
ALTER TABLE fac_Device ADD INDEX Cabinet(Cabinet);
ALTER TABLE fac_Device ADD INDEX TemplateID(TemplateID);
--
-- Clean up - we transitioned off of this table 2 releases ago
--
DROP TABLE IF EXISTS fac_DevicePorts;
DROP TABLE IF EXISTS fac_PatchConnection;
DROP TABLE IF EXISTS fac_SwitchConnection;
--
-- Bump up the database version
--
UPDATE fac_Config set Value='3.3' WHERE Parameter='Version';