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 | |
parent | eb02bd7d44776cadc4c17f72df508afd223b142f (diff) |
mandatory custom field flag, RT#9260
-rwxr-xr-x | FS/bin/freeside-upgrade | 15 | ||||
-rw-r--r-- | rt/FREESIDE_MODIFIED | 3 | ||||
-rwxr-xr-x | rt/etc/schema.mysql-4.1 | 1 |
3 files changed, 18 insertions, 1 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"; diff --git a/rt/FREESIDE_MODIFIED b/rt/FREESIDE_MODIFIED index d73a5e055..45a61062e 100644 --- a/rt/FREESIDE_MODIFIED +++ b/rt/FREESIDE_MODIFIED @@ -5,9 +5,10 @@ config.layout.in etc/RT_Config.pm etc/RT_SiteConfig.pm etc/schema.Pg + etc/schema.mysql-4.1 lib/RT/Config.pm -lib/RT?CustomField.pm #CheckMandatoryFields +lib/RT/CustomField.pm #CheckMandatoryFields lib/RT/CustomField_Overlay.pm #customfield date patch lib/RT/Interface/Web.pm #customfield date patch lib/RT/Interface/Web_Vendor.pm diff --git a/rt/etc/schema.mysql-4.1 b/rt/etc/schema.mysql-4.1 index 172e477c1..173570219 100755 --- a/rt/etc/schema.mysql-4.1 +++ b/rt/etc/schema.mysql-4.1 @@ -386,6 +386,7 @@ CREATE TABLE CustomFields ( LastUpdatedBy integer NOT NULL DEFAULT 0 , LastUpdated DATETIME NULL , Disabled int2 NOT NULL DEFAULT 0 , + Required int2 NOT NULL DEFAULT 0 , PRIMARY KEY (id) ) TYPE=InnoDB CHARACTER SET utf8; |