X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2Fbin%2Ffreeside-upgrade;h=aca545b843975eab54d25c1dd3e1c450c0709a63;hb=1a5166dc8db54e731edabb4507b475b82f1bfdef;hp=d3723a1887d26d54d5821302a074117940f4048c;hpb=3fbf293ee485c7b9245d1fadeb69c9b06ec075ed;p=freeside.git 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";