jenkins-bot has submitted this change and it was merged. Change subject: Added the db schema ......................................................................
Added the db schema The annotations are stored as Json in the annotation column and revision id identifies a particular page the annotations are associated with. The annotations are stored in the format as given here: https://github.com/okfn/annotator/wiki/Annotation-format Change-Id: I78860ce3d7049cda82177b0bbdf45065053a703f --- M Annotator.hooks.php M Annotator.php A sql/annotator.sql 3 files changed, 29 insertions(+), 2 deletions(-) Approvals: Mattflaschen: Looks good to me, approved jenkins-bot: Verified diff --git a/Annotator.hooks.php b/Annotator.hooks.php old mode 100644 new mode 100755 index 02a0969..caa6575 --- a/Annotator.hooks.php +++ b/Annotator.hooks.php @@ -3,6 +3,19 @@ */ class AnnotatorHooks { + /** LoadExtensionSchemaUpdates hook + * + * @param $updater DatabaseUpdater + * + * @return bool + */ + public static function loadExtensionSchemaUpdates( $updater = null ) { + $updater->addExtensionTable( + 'annotator', + dirname( __FILE__ ) . '/sql/annotator.sql' + ); + return true; + } /*adds the annotator js and css */ diff --git a/Annotator.php b/Annotator.php old mode 100644 new mode 100755 index adc07e7..750f94d --- a/Annotator.php +++ b/Annotator.php @@ -19,6 +19,9 @@ 'styles' => 'Annotator.css', ) + $wgAnnotatorResourcePaths; -//hooks +//Autoloading $wgAutoloadClasses['AnnotatorHooks'] = $dir . 'Annotator.hooks.php'; -$wgHooks['BeforePageDisplay'][] = 'AnnotatorHooks::onBeforePageDisplay'; \ No newline at end of file + +//Hooks +$wgHooks['BeforePageDisplay'][] = 'AnnotatorHooks::onBeforePageDisplay'; +$wgHooks['LoadExtensionSchemaUpdates'][] = 'AnnotatorHooks::loadExtensionSchemaUpdates'; \ No newline at end of file diff --git a/sql/annotator.sql b/sql/annotator.sql new file mode 100644 index 0000000..551d8b3 --- /dev/null +++ b/sql/annotator.sql @@ -0,0 +1,11 @@ +-- +-- Table structure for table `annotator` +-- + +CREATE TABLE IF NOT EXISTS /*_*/annotator ( + annotation_id int(10) unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT, + annotation_json text NOT NULL, + rev_id int(10) unsigned NOT NULL, + user_id int(10) unsigned NOT NULL +) /*$wgDBTableOptions*/; + -- To view, visit https://gerrit.wikimedia.org/r/70794 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I78860ce3d7049cda82177b0bbdf45065053a703f Gerrit-PatchSet: 8 Gerrit-Project: mediawiki/extensions/Annotator Gerrit-Branch: master Gerrit-Owner: Rjain <[email protected]> Gerrit-Reviewer: Mattflaschen <[email protected]> Gerrit-Reviewer: Parent5446 <[email protected]> Gerrit-Reviewer: Rjain <[email protected]> Gerrit-Reviewer: Springle <[email protected]> Gerrit-Reviewer: Tilgovi <[email protected]> Gerrit-Reviewer: jenkins-bot _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
