Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
367 views
in Q2A Core by

Hi, the upgrade from 1.3.3 to 1.6.3 fail on step 27 with the below error, I tried to re-upgrade, it starts on step 27 and fails, I appreciate any assistant to fix the upgrade.

Running query: LOCK TABLES q2aq2a_users WRITE, q2aq2a_userlogins WRITE, q2aq2a_userprofile WRITE, q2aq2a_userfields WRITE, q2aq2a_cookies WRITE, q2aq2a_categories WRITE, q2aq2a_pages WRITE, q2aq2a_widgets WRITE, q2aq2a_posts WRITE, q2aq2a_blobs WRITE, q2aq2a_words WRITE, q2aq2a_titlewords WRITE, q2aq2a_contentwords WRITE, q2aq2a_tagwords WRITE, q2aq2a_posttags WRITE, q2aq2a_uservotes WRITE, q2aq2a_userpoints WRITE, q2aq2a_userlimits WRITE, q2aq2a_iplimits WRITE, q2aq2a_options WRITE, q2aq2a_cache WRITE ... 

27 upgrade step/s remaining... 

Running query: ALTER TABLE q2aq2a_posts DROP FOREIGN KEY q2aq2a_posts_ibfk_3 ... 
 

Question2Answer was unable to perform the installation query below. Please check the user in the config file has CREATE and ALTER permissions:

ALTER TABLE q2aq2a_posts DROP FOREIGN KEY q2aq2a_posts_ibfk_3

Error 1025: Error on rename of './answers/q2aq2a_posts' to './answers/#sql2-436c-22e76df2' (errno: 152)

 

the current table status after the installation failure is:

`q2aq2a_posts` (
  `postid` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `categoryid` smallint(5) unsigned DEFAULT NULL,
  `type` enum('Q','A','C','Q_HIDDEN','A_HIDDEN','C_HIDDEN') NOT NULL,
  `parentid` int(10) unsigned DEFAULT NULL,
  `acount` smallint(5) unsigned NOT NULL DEFAULT '0',
  `selchildid` int(10) unsigned DEFAULT NULL,
  `userid` int(10) unsigned DEFAULT NULL,
  `cookieid` bigint(20) unsigned DEFAULT NULL,
  `createip` int(10) unsigned DEFAULT NULL,
  `lastuserid` int(10) unsigned DEFAULT NULL,
  `lastip` int(10) unsigned DEFAULT NULL,
  `upvotes` smallint(5) unsigned NOT NULL DEFAULT '0',
  `downvotes` smallint(5) unsigned NOT NULL DEFAULT '0',
  `netvotes` smallint(6) NOT NULL DEFAULT '0',
  `lastviewip` int(10) unsigned DEFAULT NULL,
  `views` int(10) unsigned NOT NULL DEFAULT '0',
  `hotness` float DEFAULT NULL,
  `flagcount` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `format` varchar(20) CHARACTER SET ascii NOT NULL DEFAULT '',
  `created` datetime NOT NULL,
  `updated` datetime DEFAULT NULL,
  `title` varchar(800) DEFAULT NULL,
  `content` varchar(8000) DEFAULT NULL,
  `tags` varchar(800) DEFAULT NULL,
  `notify` varchar(80) DEFAULT NULL,
  PRIMARY KEY (`postid`),
  KEY `type` (`type`,`created`),
  KEY `parentid` (`parentid`,`type`),
  KEY `userid` (`userid`,`type`,`created`),
  KEY `selchildid` (`selchildid`),
  KEY `type_2` (`type`,`acount`,`created`),
  KEY `createip` (`createip`,`created`),
  KEY `updated` (`updated`,`type`),
  KEY `lastip` (`lastip`,`updated`,`type`),
  KEY `type_3` (`type`,`flagcount`,`created`),
  KEY `type_4` (`type`,`netvotes`,`created`),
  KEY `type_5` (`type`,`views`,`created`),
  KEY `type_6` (`type`,`hotness`),
  CONSTRAINT `q2aq2a_posts_ibfk_1` FOREIGN KEY (`userid`) REFERENCES `q2aq2a_users` (`userid`) ON DELETE SET NULL,
  CONSTRAINT `q2aq2a_posts_ibfk_2` FOREIGN KEY (`parentid`) REFERENCES `q2aq2a_posts` (`postid`)
) ENGINE=InnoDB AUTO_INCREMENT=323215 DEFAULT CHARSET=utf8
Q2A version: 1.6.3

1 Answer

0 votes
by
selected by
 
Best answer

Have you had a look here ?

by
Thanks, actually the constrain was deleted, it seems my php script max execution is reached so the process killed.

when i started that over it failed. as i figured out the constrain does not exits, i just commented that statement from upgrade process, and everything went just fine.
...