Putting 4.2.0 on top of 4.0.17
[usit-rt.git] / etc / upgrade / 3.9.8 / content
CommitLineData
af59614d
MKG
1use strict;
2use warnings;
3
4our @Initial = sub {
01e3b242
MKG
5 my $found_fm_tables = {};
6 foreach my $name ( $RT::Handle->_TableNames ) {
7 next unless $name =~ /^fm_/i;
8 $found_fm_tables->{lc $name}++;
9 }
10
11 return unless %$found_fm_tables;
12
13 unless ( $found_fm_tables->{fm_topics} && $found_fm_tables->{fm_objecttopics} ) {
af59614d 14 RT->Logger->error("You appear to be upgrading from RTFM 2.0 - We don't support upgrading this old of an RTFM yet");
01e3b242
MKG
15 }
16
af59614d 17 RT->Logger->error("We found RTFM tables in your database. Checking for content.");
01e3b242
MKG
18
19 my $dbh = $RT::Handle->dbh;
20 my $result = $dbh->selectall_arrayref("SELECT count(*) AS articlecount FROM FM_Articles", { Slice => {} } );
21
22 if ($result->[0]{articlecount} > 0) {
af59614d 23 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");
01e3b242
MKG
24 }
25};