diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-07-09 22:18:55 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-07-09 22:18:55 -0700 |
commit | 1c538bfabc2cd31f27067505f0c3d1a46cba6ef0 (patch) | |
tree | 96922ad4459eda1e649327fd391d60c58d454c53 /rt/etc/upgrade/3.9.8 | |
parent | 4f5619288413a185e9933088d9dd8c5afbc55dfa (diff) |
RT 4.2.11, ticket#13852
Diffstat (limited to 'rt/etc/upgrade/3.9.8')
-rw-r--r-- | rt/etc/upgrade/3.9.8/content | 11 | ||||
-rw-r--r-- | rt/etc/upgrade/3.9.8/schema.Pg | 5 | ||||
-rw-r--r-- | rt/etc/upgrade/3.9.8/schema.SQLite | 6 | ||||
-rw-r--r-- | rt/etc/upgrade/3.9.8/schema.mysql | 5 |
4 files changed, 22 insertions, 5 deletions
diff --git a/rt/etc/upgrade/3.9.8/content b/rt/etc/upgrade/3.9.8/content index 24242fda2..e9a1a324d 100644 --- a/rt/etc/upgrade/3.9.8/content +++ b/rt/etc/upgrade/3.9.8/content @@ -1,4 +1,7 @@ -@Initial = sub { +use strict; +use warnings; + +our @Initial = sub { my $found_fm_tables = {}; foreach my $name ( $RT::Handle->_TableNames ) { next unless $name =~ /^fm_/i; @@ -8,15 +11,15 @@ return unless %$found_fm_tables; unless ( $found_fm_tables->{fm_topics} && $found_fm_tables->{fm_objecttopics} ) { - $RT::Logger->error("You appear to be upgrading from RTFM 2.0 - We don't support upgrading this old of an RTFM yet"); + RT->Logger->error("You appear to be upgrading from RTFM 2.0 - We don't support upgrading this old of an RTFM yet"); } - $RT::Logger->error("We found RTFM tables in your database. Checking for content."); + RT->Logger->error("We found RTFM tables in your database. Checking for content."); my $dbh = $RT::Handle->dbh; my $result = $dbh->selectall_arrayref("SELECT count(*) AS articlecount FROM FM_Articles", { Slice => {} } ); if ($result->[0]{articlecount} > 0) { - $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"); + RT->Logger->error("You appear to have RTFM Articles. You can upgrade using the /opt/rt4/etc/upgrade/upgrade-articles script. Read more about it in docs/UPGRADING-4.0"); } }; diff --git a/rt/etc/upgrade/3.9.8/schema.Pg b/rt/etc/upgrade/3.9.8/schema.Pg index d12e27a73..1f56d3b41 100644 --- a/rt/etc/upgrade/3.9.8/schema.Pg +++ b/rt/etc/upgrade/3.9.8/schema.Pg @@ -1,3 +1,4 @@ +DROP TABLE IF EXISTS Classes; CREATE TABLE Classes ( id SERIAL, Name varchar(255) NOT NULL DEFAULT '', @@ -12,6 +13,7 @@ HotList smallint NOT NULL DEFAULT 0, PRIMARY KEY (id) ); +DROP TABLE IF EXISTS Articles; CREATE TABLE Articles ( id SERIAL, Name varchar(255) NOT NULL DEFAULT '', @@ -28,6 +30,7 @@ PRIMARY KEY (id) ); +DROP TABLE IF EXISTS Topics; CREATE TABLE Topics ( id SERIAL, Parent integer NOT NULL DEFAULT 0, @@ -39,6 +42,7 @@ PRIMARY KEY (id) ); +DROP TABLE IF EXISTS ObjectTopics; CREATE TABLE ObjectTopics ( id SERIAL, Topic integer NOT NULL, @@ -48,6 +52,7 @@ PRIMARY KEY (id) ); +DROP TABLE IF EXISTS ObjectClasses; CREATE TABLE ObjectClasses ( id SERIAL, Class integer NOT NULL, diff --git a/rt/etc/upgrade/3.9.8/schema.SQLite b/rt/etc/upgrade/3.9.8/schema.SQLite index 29ed7e87a..b5af93686 100644 --- a/rt/etc/upgrade/3.9.8/schema.SQLite +++ b/rt/etc/upgrade/3.9.8/schema.SQLite @@ -1,3 +1,4 @@ +DROP TABLE IF EXISTS Classes; CREATE TABLE Classes ( id INTEGER PRIMARY KEY, Name varchar(255) NOT NULL DEFAULT '', @@ -11,6 +12,7 @@ LastUpdated TIMESTAMP NULL, HotList smallint NOT NULL DEFAULT 0 ); +DROP TABLE IF EXISTS Articles; CREATE TABLE Articles ( id INTEGER PRIMARY KEY, Name varchar(255) NOT NULL DEFAULT '', @@ -25,7 +27,7 @@ LastUpdatedBy integer NOT NULL DEFAULT 0, LastUpdated TIMESTAMP NULL ); - +DROP TABLE IF EXISTS Topics; CREATE TABLE Topics ( id INTEGER PRIMARY KEY, Parent integer NOT NULL DEFAULT 0, @@ -36,6 +38,7 @@ ObjectId integer NOT NULL ); +DROP TABLE IF EXISTS ObjectTopics; CREATE TABLE ObjectTopics ( id INTEGER PRIMARY KEY, Topic integer NOT NULL, @@ -43,6 +46,7 @@ ObjectType varchar(64) NOT NULL DEFAULT '', ObjectId integer NOT NULL ); +DROP TABLE IF EXISTS ObjectClasses; CREATE TABLE ObjectClasses ( id INTEGER PRIMARY KEY, Class integer NOT NULL, diff --git a/rt/etc/upgrade/3.9.8/schema.mysql b/rt/etc/upgrade/3.9.8/schema.mysql index e7ed84de7..4eaa3a127 100644 --- a/rt/etc/upgrade/3.9.8/schema.mysql +++ b/rt/etc/upgrade/3.9.8/schema.mysql @@ -1,3 +1,4 @@ +DROP TABLE IF EXISTS Classes; CREATE TABLE Classes ( id int(11) NOT NULL auto_increment, Name varchar(255) NOT NULL default '', @@ -12,6 +13,7 @@ CREATE TABLE Classes ( PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +DROP TABLE IF EXISTS Articles; CREATE TABLE Articles ( id int(11) NOT NULL auto_increment, Name varchar(255) NOT NULL default '', @@ -27,6 +29,7 @@ CREATE TABLE Articles ( PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +DROP TABLE IF EXISTS Topics; CREATE TABLE Topics ( id int(11) NOT NULL auto_increment, Parent int(11) NOT NULL default '0', @@ -37,6 +40,7 @@ CREATE TABLE Topics ( PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +DROP TABLE IF EXISTS ObjectTopics; CREATE TABLE ObjectTopics ( id int(11) NOT NULL auto_increment, Topic int(11) NOT NULL default '0', @@ -45,6 +49,7 @@ CREATE TABLE ObjectTopics ( PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; +DROP TABLE IF EXISTS ObjectClasses; CREATE TABLE ObjectClasses ( id int(11) NOT NULL auto_increment, Class int(11) NOT NULL default '0', |