-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
schema: Fix values to fit by increasing type sizes
The icon_image_alt column in both the host and service tables contains an image alt text. However, because it is defined as a varchar(32), many alt texts do not fit. The type has been expanded to text, as with most free text fields. Closes #752. When defining a TimePeriod, the maximum length of a range value was capped at 255 characters. This limitation has now also been removed by switching to the Text type. Closes #724. While re-reading the schema, I stumbled upon some missing properties_checksum comments that were also added.
- Loading branch information
Showing
5 changed files
with
38 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ALTER TABLE host MODIFY COLUMN icon_image_alt TEXT NOT NULL; | ||
ALTER TABLE service MODIFY COLUMN icon_image_alt TEXT NOT NULL; | ||
|
||
ALTER TABLE endpoint MODIFY COLUMN properties_checksum binary(20) NOT NULL COMMENT 'sha1(all properties)'; | ||
ALTER TABLE comment MODIFY COLUMN properties_checksum binary(20) NOT NULL COMMENT 'sha1(all properties)'; | ||
ALTER TABLE notification MODIFY COLUMN properties_checksum binary(20) NOT NULL COMMENT 'sha1(all properties)'; | ||
|
||
ALTER TABLE timeperiod_range MODIFY COLUMN range_value text NOT NULL; | ||
|
||
INSERT INTO icingadb_schema (version, timestamp) | ||
VALUES (6, UNIX_TIMESTAMP() * 1000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
ALTER TABLE host ALTER COLUMN icon_image_alt TYPE text; | ||
ALTER TABLE service ALTER COLUMN icon_image_alt TYPE text; | ||
|
||
COMMENT ON COLUMN endpoint.properties_checksum IS 'sha1(all properties)'; | ||
COMMENT ON COLUMN comment.properties_checksum IS 'sha1(all properties)'; | ||
COMMENT ON COLUMN notification.properties_checksum IS 'sha1(all properties)'; | ||
|
||
ALTER TABLE timeperiod_range ALTER COLUMN range_value TYPE text; | ||
|
||
INSERT INTO icingadb_schema (version, timestamp) | ||
VALUES (4, extract(epoch from now()) * 1000); |