+sub _upgrade_data {
+ return if $system ne 'RT_Internal';
+
+ my ($class, %opts) = @_;
+ my ($t, $exec, @fields) = map { driver_name =~ /^mysql/i ? $_ : lc($_) }
+ (qw( ScripConditions ExecModule
+ Name Description ExecModule ApplicableTransTypes
+ Creator Created LastUpdatedBy LastUpdated));
+ my $count_sql = "SELECT COUNT(*) FROM $t WHERE $exec = 'CustomFieldChange'";
+ my $sth = dbh->prepare($count_sql) or die dbh->errstr;
+ $sth->execute or die $sth->errstr;
+ my $total = $sth->fetchrow_arrayref->[0];
+ return if $total > 0;
+
+ my $insert_sql = "INSERT INTO $t (".join(',',@fields).") VALUES (".
+ "'On Custom Field Change', 'When a custom field is changed to some value',
+ 'CustomFieldChange', 'Any', 1, CURRENT_DATE, 1, CURRENT_DATE )";
+ $sth = dbh->prepare($insert_sql) or die dbh->errstr;
+ $sth->execute or die $sth->errstr;
+ return;
+}
+