-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changing the function that sets a column in the part that turns from NULL to not NULL to set any found NULL values on the changed column values to a default value according to the column type. This script changes also upgrade scripts to pass the v_type new parameter. In case that unsupported type is passed, an error is thrown. This patch also removed redundant code added in PRs 297 and 300 Signed-off-by: Eli Mesika <emesika@redhat.com> Bug-Url: https://bugzilla.redhat.com/2077387 Allow-db-upgrade-script-changes: Yes
- Loading branch information
Showing
3 changed files
with
31 additions
and
24 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
23 changes: 2 additions & 21 deletions
23
packaging/dbscripts/upgrade/04_05_0100_fix_04_04_0050_set_to_not_null.sql
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 |
---|---|---|
@@ -1,21 +1,2 @@ | ||
-- Make sure that forgotten options from ancient releases have default value | ||
UPDATE vdc_options | ||
SET default_value = option_value | ||
WHERE | ||
default_value IS NULL | ||
AND option_value IS NOT NULL; | ||
|
||
-- If there are still some crappy options, let's set default value to empty string | ||
UPDATE vdc_options | ||
SET default_value = '' | ||
WHERE | ||
default_value IS NULL | ||
AND option_value IS NULL; | ||
|
||
-- We shouldn't have any options with NULL values by now, but let's make sure | ||
UPDATE vdc_options | ||
SET option_value = '' | ||
WHERE option_value IS NULL; | ||
|
||
SELECT fn_db_change_column_null('vdc_options', 'default_value', false); | ||
SELECT fn_db_change_column_null('vdc_options', 'option_value', false); | ||
SELECT fn_db_change_column_null('vdc_options', 'default_value', false, 'text'); | ||
SELECT fn_db_change_column_null('vdc_options', 'option_value', false, 'text'); |
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