spacer
spacer search

SwissCenter

Search
spacer
Main Menu
Home
Documentation + FAQ
Screenshots
Downloads
Forums
Bug Tracking
History
Login
Username

Password

Remember me
?
No account yet?

Locations of visitors to this page

 
Home arrow Forums

SwissCenter Forums  


Recreate database: Apply patch 31 fails - 2010/01/23 13:52 Hi, I had to recreate the swiss database.

It failed with patch 31.
a snippit from the log:
Code:

 [2010.01.23 19:32:44Applying database patch [0031] [2010.01.23 19:32:44Duplicate column name 'cat_id' [2010.01.23 19:32:44] -- ----------------------------------------------------------------------------------------------- -- [2010.01.23 19:32:44]  -- Update the internet bookmarks to be assigned categories and have certificates [2010.01.23 19:32:44]  -- ---------------------------------------------------------------------------------------------- --- [2010.01.23 19:32:44]   [2010.01.23 19:32:44]  ALTER TABLE internet_urls ADD cat_id INT UNSIGNED NOT NULL DEFAULT 1 [2010.01.23 19:32:44Duplicate column name 'certificate' [2010.01.23 19:32:44]  [2010.01.23 19:32:44]  ALTER TABLE internet_urls ADD certificate INT UNSIGNED NULL [2010.01.23 19:32:44Can't create table 'swiss.#sql-8b8_569' (errno: 150) [2010.01.23 19:32:44]  [2010.01.23 19:32:44]  ALTER TABLE internet_urls ADD CONSTRAINT FOREIGN KEY (certificateREFERENCES certificates(cert_idON DELETE SET NULL [2010.01.23 19:32:44Failed to apply database patch [0031]



After looking in to this, I found the problem was the DB-engine of the certificates table, which was myisam, but should be InnoDb.

I altered update 31 to

Code:

  -- ------------------------------------------------------------------------------------------------- -- Update the internet bookmarks to be assigned categories and have certificates -- ------------------------------------------------------------------------------------------------- -- ALTER TABLE internet_urls ADD cat_id INT UNSIGNED NOT NULL DEFAULT 1; -- ALTER TABLE internet_urls ADD certificate INT UNSIGNED NULL; ALTER TABLE certificates ENGINE InnoDB; ALTER TABLE internet_urls ADD CONSTRAINT FOREIGN KEY (certificateREFERENCES certificates(cert_idON DELETE SET NULL;



Maybe in the final patch the first two alter table queries need to be enabled, because they succeed the first time you try to apply this patch. (and I applied it multiple times)

I used the following environment:
Webserver : Apache v2.2.11
PHP : v5.2.8
MySQL : v5.1.30-community
SwissCenter: Subversion r1366
  | | The administrator has disabled public write access.

      Topics Author Date
    thread link
Recreate database: Apply patch 31 fails
Magician 2010/01/23 13:52
    thread link
thread linkthread link Re: Recreate database: Apply patch 31 fails
Pernod 2010/01/24 13:31
    thread link
thread linkthread linkthread link Re: Recreate database: Apply patch 31 fails
Magician 2010/01/25 08:33
    thread link
thread linkthread linkthread linkthread link Re: Recreate database: Apply patch 31 fails
Pernod 2010/01/25 10:37
    thread link
thread linkthread linkthread linkthread linkthread link Re: Recreate database: Apply patch 31 fails
Magician 2010/01/25 10:57
    thread link
thread linkthread linkthread linkthread linkthread linkthread link Re: Recreate database: Apply patch 31 fails
Pernod 2010/01/25 11:45
spacer
 

Screenshots

www.flickr.com
This is a Flickr badge showing public photos from swisscenter. Make your own badge here.


 

Mambo is Free Software released under the GNU/GPL License.
spacer