Merge branch 'master' of https://github.com/jgoodman/Freeside
[freeside.git] / rt / etc / upgrade / 3.9.8 / content
1 @Initial = sub {
2     my $found_fm_tables = {};
3     foreach my $name ( $RT::Handle->_TableNames ) {
4         next unless $name =~ /^fm_/i;
5         $found_fm_tables->{lc $name}++;
6     }
7
8     return unless %$found_fm_tables;
9
10     unless ( $found_fm_tables->{fm_topics} && $found_fm_tables->{fm_objecttopics} ) {
11         $RT::Logger->error("You appear to be upgrading from RTFM 2.0 - We don't support upgrading this old of an RTFM yet");
12     }
13
14     $RT::Logger->error("We found RTFM tables in your database.  Checking for content.");
15
16     my $dbh = $RT::Handle->dbh;
17     my $result = $dbh->selectall_arrayref("SELECT count(*) AS articlecount FROM FM_Articles", { Slice => {} } );
18
19     if ($result->[0]{articlecount} > 0) {
20         $RT::Logger->error("You appear to have RTFM Articles.  You can upgrade using the etc/upgrade/upgrade-articles script.  Read more about it in docs/UPGRADING-4.0");
21     }
22 };