Index: trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php |
— | — | @@ -59,8 +59,18 @@ |
60 | 60 | dirname( __FILE__ ) . '/ArticleFeedback.sql' |
61 | 61 | ); |
62 | 62 | } else { |
63 | | - $updater->addExtensionUpdate( array( 'addTable', 'article_feedback', |
64 | | - dirname( __FILE__ ) . '/ArticleFeedback.sql', true ) ); |
| 63 | + $dir = dirname( __FILE__ ); |
| 64 | + $db = $updater->getDB(); |
| 65 | + |
| 66 | + if ( !$db->tableExists( 'article_feedback' ) ) { |
| 67 | + if ( $db->tableExists( 'article_assessment' ) ) { |
| 68 | + $updater->addExtensionUpdate( array( 'addTable', 'article_feedback', |
| 69 | + $dir . '/RenameTables.sql', true ) ); // Rename tables |
| 70 | + } else { |
| 71 | + $updater->addExtensionUpdate( array( 'addTable', 'article_feedback', |
| 72 | + $dir . '/ArticleFeedback.sql', true ) ); // Initial install tables |
| 73 | + } |
| 74 | + } |
65 | 75 | } |
66 | 76 | return true; |
67 | 77 | } |
Index: trunk/extensions/ArticleFeedback/RenameTables.sql |
— | — | @@ -0,0 +1,3 @@ |
| 2 | +RENAME TABLE /*$wgDBprefix*/article_assessment_ratings TO /*$wgDBprefix*/article_feedback_ratings, |
| 3 | + /*$wgDBprefix*/article_assessment TO /*$wgDBprefix*/article_feedback, |
| 4 | + /*$wgDBprefix*/article_assessment_pages TO /*$wgDBprefix*/article_feedback_pages; |
\ No newline at end of file |
Property changes on: trunk/extensions/ArticleFeedback/RenameTables.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 5 | + native |