forked from louislam/uptime-kuma
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π fix: boolean fields in kafka producer monitor (louislam#3949)
* π fix: boolean fields in kafka producer monitor Signed-off-by: Muhammed Hussein Karimi <[email protected]> * π fix: boolean fields db patch table modify Signed-off-by: Muhammed Hussein Karimi <[email protected]> * βοΈ typo: remove `_old` COLUMNs in patch-fix-kafka-producer-booleans Signed-off-by: Muhammed Hussein Karimi <[email protected]> --------- Signed-off-by: Muhammed Hussein Karimi <[email protected]>
- Loading branch information
1 parent
1a862e4
commit 9f170a6
Showing
5 changed files
with
52 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
-- You should not modify if this have pushed to Github, unless it does serious wrong with the db. | ||
BEGIN TRANSACTION; | ||
|
||
-- Rename COLUMNs to another one (suffixed by `_old`) | ||
ALTER TABLE monitor | ||
RENAME COLUMN kafka_producer_ssl TO kafka_producer_ssl_old; | ||
|
||
ALTER TABLE monitor | ||
RENAME COLUMN kafka_producer_allow_auto_topic_creation TO kafka_producer_allow_auto_topic_creation_old; | ||
|
||
-- Add correct COLUMNs | ||
ALTER TABLE monitor | ||
ADD COLUMN kafka_producer_ssl BOOLEAN default 0 NOT NULL; | ||
|
||
ALTER TABLE monitor | ||
ADD COLUMN kafka_producer_allow_auto_topic_creation BOOLEAN default 0 NOT NULL; | ||
|
||
-- Set bring old values from `_old` COLUMNs to correct ones | ||
UPDATE monitor set kafka_producer_allow_auto_topic_creation = monitor.kafka_producer_allow_auto_topic_creation_old; | ||
UPDATE monitor set kafka_producer_ssl = monitor.kafka_producer_ssl_old; | ||
|
||
-- Remove old COLUMNs | ||
ALTER TABLE monitor | ||
DROP COLUMN kafka_producer_allow_auto_topic_creation_old; | ||
|
||
ALTER TABLE monitor | ||
DROP COLUMN kafka_producer_ssl_old; | ||
|
||
COMMIT; |
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
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