forked from opendcim/openDCIM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
db-1.3-to-1.4.sql
97 lines (80 loc) · 3.28 KB
/
db-1.3-to-1.4.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
--
-- Changes to openDCIM database for migrating from 1.3 to 1.4
--
--
-- Bump version number up
--
UPDATE fac_Config SET Value = '1.4' WHERE fac_Config.Parameter = 'Version';
--
-- Table structure for fac_SupplyBin
--
DROP TABLE IF EXISTS fac_SupplyBin;
CREATE TABLE fac_SupplyBin (
BinID int(11) NOT NULL AUTO_INCREMENT,
Location varchar(40) NOT NULL,
PRIMARY KEY (BinID)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
--
-- Table structure for fac_Supplies
--
DROP TABLE IF EXISTS fac_Supplies;
CREATE TABLE fac_Supplies (
SupplyID int(11) NOT NULL AUTO_INCREMENT,
PartNum varchar(40) NOT NULL,
PartName varchar(80) NOT NULL,
MinQty int(11) NOT NULL,
MaxQty int(11) NOT NULL,
PRIMARY KEY (SupplyID)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
--
-- Table structure for fac_BinContents
--
DROP TABLE IF EXISTS fac_BinContents;
CREATE TABLE fac_BinContents (
BinID int(11) NOT NULL,
SupplyID int(11) NOT NULL,
Count int(11) NOT NULL
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
--
-- Table structure for fac_BinAudits
--
DROP TABLE IF EXISTS fac_BinAudits;
CREATE TABLE fac_BinAudits (
BinID int(11) NOT NULL,
UserID int(11) NOT NULL,
AuditStamp datetime NOT NULL
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
--
-- Style Customization
--
INSERT INTO `fac_Config` (`Parameter`, `Value`, `UnitOfMeasure`, `ValType`, `DefaultVal`) VALUES
('HeaderColor', '#006633', 'HexColor', 'string', '#006633'),
('BodyColor', '#F0E0B2', 'HexColor', 'string', '#F0E0B2'),
('LinkColor', '#000000', 'HexColor', 'string', '#000000'),
('VisitedLinkColor', '#8D90B3', 'HexColor', 'string', '#8D90B3');
--
-- Moved deadlines for rack requests into configuration table
--
INSERT INTO `fac_Config` (`Parameter`, `Value`, `UnitOfMeasure`, `ValType`, `DefaultVal`) VALUES
('RackWarningHours', 4, 'Hours', 'integer', '4'),
('RackOverdueHours', 1, 'Hours', 'integer', '1');
--
-- Not sure how this got overlooked for several releases
--
ALTER TABLE fac_RackRequest ADD MfgDate DATE NOT NULL AFTER SerialNo;
--
-- Add database structure changes for Parent/Child relationships of Chassis / Slots
--
ALTER TABLE fac_Device add column ChassisSlots smallint(6) NOT NULL AFTER DeviceType;
ALTER TABLE fac_Device add column ParentDevice int(11) NOT NULL AFTER ChassisSlots;
--
-- Change the DeviceType enumeration from having 'Routing Chassis' to just plain 'Chassis'
--
ALTER TABLE fac_Device MODIFY COLUMN DeviceType enum('Server','Appliance','Storage Array','Switch','Routing Chassis','Patch Panel','Physical Infrastructure','Chassis');
UPDATE fac_Device SET DeviceType='Chassis' WHERE DeviceType = 'Routing Chassis';
ALTER TABLE fac_Device MODIFY COLUMN DeviceType enum('Server','Appliance','Storage Array','Switch','Patch Panel','Physical Infrastructure','Chassis');
--
-- Change the TemplateDevice enumeration from having 'Routing Chassis' to just plain 'Chassis'
ALTER TABLE fac_DeviceTemplate MODIFY COLUMN DeviceType enum('Server','Appliance','Storage Array','Switch','Routing Chassis','Patch Panel','Physical Infrastructure','Chassis');
UPDATE fac_DeviceTemplate set DeviceType='Chassis' WHERE DeviceType = 'Routing Chassis';
ALTER TABLE fac_DeviceTemplate MODIFY COLUMN DeviceType enum('Server','Appliance','Storage Array','Switch','Patch Panel','Physical Infrastructure','Chassis');