You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
1020 B
30 lines
1020 B
1 year ago
|
-- 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;
|