diff options
author | mark <mark> | 2010-10-02 20:54:27 +0000 |
---|---|---|
committer | mark <mark> | 2010-10-02 20:54:27 +0000 |
commit | 97803d56c88dc4760140d912a76cb2730fcbf713 (patch) | |
tree | eb99516925f32d36234d391f75746af9785463a9 /FS | |
parent | eb02bd7d44776cadc4c17f72df508afd223b142f (diff) |
mandatory custom field flag, RT#9260
Diffstat (limited to 'FS')
-rwxr-xr-x | FS/bin/freeside-upgrade | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/FS/bin/freeside-upgrade b/FS/bin/freeside-upgrade index d3723a188..aca545b84 100755 --- a/FS/bin/freeside-upgrade +++ b/FS/bin/freeside-upgrade @@ -71,6 +71,21 @@ if ( dbdef->table('cgp_rule_condition') && } +# RT required field flag +# for consistency with RT schema: mysql is in CamelCase, +# pg is in lowercase, and they use different data types. +my ($t, $creq, $cdis) = + map { driver_name =~ /^mysql/i ? $_ : lc($_) } + ('CustomFields','Required','Disabled'); + +if ( dbdef->table($t) && + ! dbdef->table($t)->column($creq) ) { + push @bugfix, + "ALTER TABLE $t ADD COLUMN $creq ". + dbdef->table($t)->column($cdis)->type . + ' NOT NULL DEFAULT 0'; +} + if ( $DRY_RUN ) { print join(";\n", @bugfix ). ";\n"; |