/** * @param DatabaseUpdater $updater * @return bool */ public static function addSchemaUpdates(DatabaseUpdater $updater) { $base = dirname(__FILE__); if ($updater->getDB()->getType() == 'mysql') { $base = "{$base}/mysql"; $updater->addExtensionTable('account_requests', "{$base}/ConfirmAccount.sql", true); $updater->addExtensionField('account_requests', 'acr_filename', "{$base}/patch-acr_filename.sql"); $updater->addExtensionTable('addTable', 'account_credentials', "{$base}/patch-account_credentials.sql", true); $updater->addExtensionField('account_requests', 'acr_areas', "{$base}/patch-acr_areas.sql", true); $updater->addExtensionIndex('account_requests', 'acr_email', "{$base}/patch-email-index.sql", true); } elseif ($updater->getDB()->getType() == 'postgres') { $base = "{$base}/postgres"; $updater->addExtensionUpdate(array('addTable', 'account_requests', "{$base}/ConfirmAccount.pg.sql", true)); $updater->addExtensionUpdate(array('addPgField', 'account_requests', 'acr_held', "TIMESTAMPTZ")); $updater->addExtensionUpdate(array('addPgField', 'account_requests', 'acr_filename', "TEXT")); $updater->addExtensionUpdate(array('addPgField', 'account_requests', 'acr_storage_key', "TEXT")); $updater->addExtensionUpdate(array('addPgField', 'account_requests', 'acr_comment', "TEXT NOT NULL DEFAULT ''")); $updater->addExtensionUpdate(array('addPgField', 'account_requests', 'acr_type', "INTEGER NOT NULL DEFAULT 0")); $updater->addExtensionUpdate(array('addTable', 'account_credentials', "{$base}/patch-account_credentials.sql", true)); $updater->addExtensionUpdate(array('addPgField', 'account_requests', 'acr_areas', "TEXT")); $updater->addExtensionUpdate(array('addPgField', 'account_credentials', 'acd_areas', "TEXT")); $updater->addExtensionUpdate(array('addIndex', 'account_requests', 'acr_email', "{$base}/patch-email-index.sql", true)); } return true; }
public static function SetupSchema( DatabaseUpdater $du ) { $base = dirname( __FILE__ ) . '/schema'; $du->addExtensionTable( "ratings", "$base/ratings.sql"); $du->addExtensionTable( "project_stats", "$base/project_stats.sql" ); $du->addExtensionTable( "assessment_changelog", "$base/log.sql" ); $du->addExtensionTable( "selections", "$base/selections.sql" ); return true; }
function SemanticMailMerge_SchemaUpdates(DatabaseUpdater $updater) { $sqldir = __DIR__ . '/maintenance/'; $updater->addExtensionTable('smw_mailmerge', $sqldir . 'table.sql'); $updater->addExtensionIndex('smw_mailmerge', 'title', $sqldir . 'index.sql'); return true; }
/** * Schema update to set up the needed database tables. * * @since 1.2 * * @param DatabaseUpdater $updater * * @return true */ public static function onSchemaUpdate($updater = null) { $updater->addExtensionTable('uw_campaigns', dirname(__FILE__) . '/UploadWizard.sql'); $updater->addExtensionUpdate(array('addIndex', 'uw_campaigns', 'uw_campaigns_name', dirname(__FILE__) . '/sql/UW_IndexCampaignsName.sql', true)); $updater->addExtensionUpdate(array('addIndex', 'uw_campaign_conf', 'uw_cc_id_property', dirname(__FILE__) . '/sql/UW_IndexConfIdProp.sql', true)); $updater->addExtensionUpdate(array('addIndex', 'uw_campaign_conf', 'uw_cc_property', dirname(__FILE__) . '/sql/UW_IndexConfProp.sql', true)); return true; }
/** * Schema update to set up the needed database tables. * @see https://www.mediawiki.org/wiki/Manual:Hooks/LoadExtensionSchemaUpdates * * @since 0.1 * * @param DatabaseUpdater $updater * * @return true */ public static function onSchemaUpdate(DatabaseUpdater $updater) { $updater->addExtensionTable('ep_orgs', dirname(__FILE__) . '/sql/EducationProgram.sql'); $updater->addExtensionUpdate(array('addTable', 'ep_oas_per_course', dirname(__FILE__) . '/sql/AddAmbassadorLinks.sql', true)); $updater->addExtensionUpdate(array('addField', 'ep_oas_per_course', 'opc_user_id', dirname(__FILE__) . '/sql/RenameAmbUserField.sql', true)); $updater->addExtensionUpdate(array('addField', 'ep_revisions', 'rev_object_identifier', dirname(__FILE__) . '/sql/AddRevIdentifier.sql', true)); return true; }
/** * LoadExtensionSchemaUpdates hook handler * @see https://www.mediawiki.org/wiki/Manual:Hooks/LoadExtensionSchemaUpdates * @param DatabaseUpdater $updater */ public static function onLoadExtensionSchemaUpdates(DatabaseUpdater $updater) { if ($updater->getDB()->getType() != 'mysql') { throw new MWException('GeoData extension currently supports only MySQL'); } $updater->addExtensionTable('geo_tags', dirname(__FILE__) . '/GeoData.sql'); return true; }
/** * Schema update to set up the needed database tables. * @see https://www.mediawiki.org/wiki/Manual:Hooks/LoadExtensionSchemaUpdates * * @since 0.1 * * @param DatabaseUpdater $updater * * @return true */ public static function onSchemaUpdate(DatabaseUpdater $updater) { $updater->addExtensionTable('ep_orgs', dirname(__FILE__) . '/sql/EducationProgram.sql'); $updater->addExtensionUpdate(array('addField', 'ep_orgs', 'org_courses', dirname(__FILE__) . '/sql/AddExtraFields.sql', true)); $updater->addExtensionUpdate(array('addField', 'ep_orgs', 'org_active', dirname(__FILE__) . '/sql/AddStatusFields.sql', true)); $updater->addExtensionUpdate(array('addField', 'ep_courses', 'course_instructors', dirname(__FILE__) . '/sql/AddMentorFields.sql', true)); $updater->addExtensionUpdate(array('addField', 'ep_terms', 'term_students', dirname(__FILE__) . '/sql/AddStudentsField.sql', true)); return true; }
/** * Schema update to set up the needed database tables. * * @since 1.2 * * @param DatabaseUpdater $updater * * @return true */ public static function onSchemaUpdate($updater = null) { $dbfile = dirname(__FILE__) . '/UploadWizard.' . $updater->getDB()->getType() . '.sql'; if (!file_exists($dbfile)) { $dbfile = dirname(__FILE__) . '/UploadWizard.sql'; } $updater->addExtensionTable('uw_campaigns', $dbfile); $updater->addExtensionUpdate(array('addIndex', 'uw_campaigns', 'uw_campaigns_name', dirname(__FILE__) . '/sql/UW_IndexCampaignsName.sql', true)); $updater->addExtensionUpdate(array('addIndex', 'uw_campaigns', 'uw_campaigns_enabled', dirname(__FILE__) . '/sql/UW_IndexCampaignsEnabled.sql', true)); return true; }
/** * @param $updater DatabaseUpdater * @return bool */ public static function asUpdateSchema(DatabaseUpdater $updater) { $updater->addExtensionTable('spoofuser', __DIR__ . '/sql/patch-antispoof.' . $updater->getDB()->getType() . '.sql'); return true; }
/** * @param DatabaseUpdater $updater */ public static function onLoadExtensionSchemaUpdates($updater) { $updater->addExtensionTable('author_rating', dirname(__FILE__) . '/schema/author_rating.sql'); }
/** * @param DatabaseUpdater $updater */ public static function onLoadExtensionSchemaUpdates($updater) { global $wgOpauthLoginDir; $updater->addExtensionTable('opauth_login', $wgOpauthLoginDir . '/schema/opauth_login.sql'); }
/** * This will setup database tables for layer functionality. * * @since 3.0 * * @param DatabaseUpdater $updater * * @return true */ public static function onLoadExtensionSchemaUpdates(DatabaseUpdater $updater) { switch ($GLOBALS['wgDBtype']) { case 'mysql': case 'sqlite': $updater->addExtensionTable('maps_layers', __DIR__ . '/schema/MapsLayers.sql'); break; case 'postgres': $updater->addExtensionTable('maps_layers', __DIR__ . '/schema/MapsLayers-postgres.sql'); break; } return true; }
/** * This will setup database tables for layer functionality. * * @since 3.0 * * @global type $wgDBtype * @param DatabaseUpdater $updater * * @return true */ public static function onLoadExtensionSchemaUpdates(DatabaseUpdater $updater) { global $wgDBtype; switch ($wgDBtype) { case 'mysql': case 'sqlite': $sqlPath = dirname(__FILE__) . '/schema/MapsLayers.sql'; break; /** @ToDo: Support for Postgree SQL and others **/ } $updater->addExtensionTable('maps_layers', $sqlPath); return true; }
public static function onLoadExtensionSchemaUpdates(DatabaseUpdater $updater) { $dir = __DIR__ . '/sql'; $updater->addExtensionTable('invitesignup', "{$dir}/invitesignup.sql"); }
/** * This registers our database schema update(s) */ public static function onLoadExtensionSchemaUpdates(DatabaseUpdater $updater) { $updater->addExtensionTable('spell_dict_word_list', dirname(__FILE__) . '/sql/spelling_dictionary.sql', true); return true; }
function fnCreateWikiSchemaUpdates(DatabaseUpdater $updater) { $updater->addExtensionTable('cw_requests', __DIR__ . '/cw_requests.sql'); return true; }
/** * Hook: LoadExtensionSchemaUpdates * * @param $updater DatabaseUpdater object * @return bool true in all cases */ public static function getSchemaUpdates(DatabaseUpdater $updater) { $dir = __DIR__; $baseSQLFile = "{$dir}/flow.sql"; $updater->addExtensionTable('flow_revision', $baseSQLFile); $updater->addExtensionField('flow_revision', 'rev_last_edit_id', "{$dir}/db_patches/patch-revision_last_editor.sql"); $updater->addExtensionField('flow_revision', 'rev_mod_reason', "{$dir}/db_patches/patch-moderation_reason.sql"); if ($updater->getDB()->getType() === 'sqlite') { $updater->modifyExtensionField('flow_summary_revision', 'summary_workflow_id', "{$dir}/db_patches/patch-summary2header.sqlite.sql"); $updater->modifyExtensionField('flow_revision', 'rev_comment', "{$dir}/db_patches/patch-rev_change_type.sqlite.sql"); // sqlite ignores field types, this just substr's uuid's to 88 bits $updater->modifyExtensionField('flow_workflow', 'workflow_id', "{$dir}/db_patches/patch-88bit_uuids.sqlite.sql"); $updater->addExtensionField('flow_workflow', 'workflow_type', "{$dir}/db_patches/patch-add_workflow_type.sqlite"); $updater->modifyExtensionField('flow_workflow', 'workflow_user_id', "{$dir}/db_patches/patch-default_null_workflow_user.sqlite.sql"); } else { // sqlite doesn't support alter table change, it also considers all types the same so // this patch doesn't matter to it. $updater->modifyExtensionField('flow_subscription', 'subscription_user_id', "{$dir}/db_patches/patch-subscription_user_id.sql"); // renames columns, alternate patch is above for sqlite $updater->modifyExtensionField('flow_summary_revision', 'summary_workflow_id', "{$dir}/db_patches/patch-summary2header.sql"); // rename rev_change_type -> rev_comment, alternate patch is above for sqlite $updater->modifyExtensionField('flow_revision', 'rev_comment', "{$dir}/db_patches/patch-rev_change_type.sql"); // convert 128 bit uuid's into 88bit $updater->modifyExtensionField('flow_workflow', 'workflow_id', "{$dir}/db_patches/patch-88bit_uuids.sql"); $updater->addExtensionField('flow_workflow', 'workflow_type', "{$dir}/db_patches/patch-add_workflow_type.sql"); $updater->modifyExtensionField('flow_workflow', 'workflow_user_id', "{$dir}/db_patches/patch-default_null_workflow_user.sql"); // Doesn't need SQLite support, since SQLite doesn't care about text widths. $updater->modifyExtensionField('flow_workflow', 'workflow_wiki', "{$dir}/db_patches/patch-increase_width_wiki_fields.sql"); } $updater->addExtensionIndex('flow_workflow', 'flow_workflow_lookup', "{$dir}/db_patches/patch-workflow_lookup_idx.sql"); $updater->addExtensionIndex('flow_topic_list', 'flow_topic_list_topic_id', "{$dir}/db_patches/patch-topic_list_topic_id_idx.sql"); $updater->modifyExtensionField('flow_revision', 'rev_change_type', "{$dir}/db_patches/patch-rev_change_type_update.sql"); $updater->modifyExtensionField('recentchanges', 'rc_source', "{$dir}/db_patches/patch-rc_source.sql"); $updater->modifyExtensionField('flow_revision', 'rev_change_type', "{$dir}/db_patches/patch-censor_to_suppress.sql"); $updater->addExtensionField('flow_revision', 'rev_user_ip', "{$dir}/db_patches/patch-remove_usernames.sql"); $updater->addExtensionField('flow_revision', 'rev_user_wiki', "{$dir}/db_patches/patch-add-wiki.sql"); $updater->addExtensionIndex('flow_tree_revision', 'flow_tree_descendant_rev_id', "{$dir}/db_patches/patch-flow_tree_idx_fix.sql"); $updater->dropExtensionField('flow_tree_revision', 'tree_orig_create_time', "{$dir}/db_patches/patch-tree_orig_create_time.sql"); $updater->addExtensionIndex('flow_revision', 'flow_revision_user', "{$dir}/db_patches/patch-revision_user_idx.sql"); $updater->modifyExtensionField('flow_revision', 'rev_user_ip', "{$dir}/db_patches/patch-revision_user_ip.sql"); $updater->addExtensionField('flow_revision', 'rev_type_id', "{$dir}/db_patches/patch-rev_type_id.sql"); $updater->addExtensionTable('flow_ext_ref', "{$dir}/db_patches/patch-add-linkstables.sql"); $updater->dropExtensionTable('flow_definition', "{$dir}/db_patches/patch-drop_definition.sql"); $updater->dropExtensionField('flow_workflow', 'workflow_user_ip', "{$dir}/db_patches/patch-drop_workflow_user.sql"); $updater->addExtensionField('flow_revision', 'rev_content_length', "{$dir}/db_patches/patch-add-revision-content-length.sql"); $updater->addExtensionIndex('flow_ext_ref', 'flow_ext_ref_idx', "{$dir}/db_patches/patch-remove_unique_ref_indices.sql"); $updater->addExtensionIndex('flow_workflow', 'flow_workflow_update_timestamp', "{$dir}/db_patches/patch-flow_workflow_update_timestamp_idx.sql"); require_once __DIR__ . '/maintenance/FlowUpdateRecentChanges.php'; $updater->addPostDatabaseUpdateMaintenance('FlowUpdateRecentChanges'); require_once __DIR__ . '/maintenance/FlowSetUserIp.php'; $updater->addPostDatabaseUpdateMaintenance('FlowSetUserIp'); /* * Remove old *_user_text columns once the maintenance script that * moves the necessary data has been run. * This duplicates what is being done in FlowSetUserIp already, but that * was not always the case, so that script may have already run without * having executed this. */ if ($updater->updateRowExists('FlowSetUserIp')) { $updater->dropExtensionField('flow_revision', 'rev_user_text', "{$dir}/db_patches/patch-remove_usernames_2.sql"); } require_once __DIR__ . '/maintenance/FlowUpdateUserWiki.php'; $updater->addPostDatabaseUpdateMaintenance('FlowUpdateUserWiki'); require_once __DIR__ . '/maintenance/FlowUpdateRevisionTypeId.php'; $updater->addPostDatabaseUpdateMaintenance('FlowUpdateRevisionTypeId'); require_once __DIR__ . '/maintenance/FlowPopulateLinksTables.php'; $updater->addPostDatabaseUpdateMaintenance('FlowPopulateLinksTables'); require_once __DIR__ . '/maintenance/FlowFixLog.php'; $updater->addPostDatabaseUpdateMaintenance('FlowFixLog'); require_once __DIR__ . '/maintenance/FlowUpdateWorkflowPageId.php'; $updater->addPostDatabaseUpdateMaintenance('FlowUpdateWorkflowPageId'); require_once __DIR__ . '/maintenance/FlowCreateMentionTemplate.php'; $updater->addPostDatabaseUpdateMaintenance('FlowCreateMentionTemplate'); return true; }
public static function onLoadExtensionSchemaUpdates(\DatabaseUpdater $updater) { $updater->addExtensionTable('pagerating_records', __DIR__ . '/sql/create-table.sql', true); return true; }
function TMWAccountSql(DatabaseUpdater $updater) { $updater->addExtensionTable('tmw_accounts', dirname(__FILE__) . '/sql/createTables.sql', true); return true; }
public static function onLoadExtensionSchemaUpdates(DatabaseUpdater $updater) { /* Tables that define a specific game, and what sort of stats its characters have */ $updater->addExtensionTable('fate_game', __DIR__ . '/sql/Game.sql'); $updater->addExtensionTable('fate_game_aspect', __DIR__ . '/sql/GameAspect.sql'); $updater->addExtensionTable('fate_game_condition', __DIR__ . '/sql/GameCondition.sql'); $updater->addExtensionTable('fate_game_consequence', __DIR__ . '/sql/GameConsequence.sql'); $updater->addExtensionTable('fate_game_mode', __DIR__ . '/sql/GameMode.sql'); $updater->addExtensionTable('fate_game_mode_skill', __DIR__ . '/sql/GameModeSkill.sql'); $updater->addExtensionTable('fate_game_skill', __DIR__ . '/sql/GameSkill.sql'); $updater->addExtensionTable('fate_game_stress', __DIR__ . '/sql/GameStress.sql'); $updater->addExtensionTable('fate_game_turn_order', __DIR__ . '/sql/GameTurnOrder.sql'); $updater->addExtensionTable('fate_game_staff', __DIR__ . '/sql/GameStaff.sql'); /* Tables that define the 'fractals' for a game, where a fractal is any thing that has stats */ $updater->addExtensionTable('fate_fractal', __DIR__ . '/sql/Fractal.sql'); $updater->addExtensionTable('fate_fractal_stat', __DIR__ . '/sql/FractalStat.sql'); $updater->addExtensionTable('fate_pending_stat', __DIR__ . '/sql/PendingStat.sql'); return true; }
public static function mySchemaUpdate(DatabaseUpdater $updater) { $updater->addExtensionTable('tablename', __DIR__ . '/table.sql'); return true; }
/** * @param $du DatabaseUpdater * @return bool */ public static function setupSchema( DatabaseUpdater $du ) { $base = dirname( __FILE__ ) . '/schemas'; $du->addExtensionTable( 'shorturls', "$base/shorturls.sql" ); return true; }
/** * This method gets called by the MediaWiki Framework * @param DatabaseUpdater $updater Provided by MediaWikis update.php * @return boolean Always true to keep the hook running */ public static function getSchemaUpdates($updater) { global $wgDBtype; switch ($wgDBtype) { case 'postgres': $updater->addExtensionTable('bs_responsible_editors', __DIR__ . '/db/ResponsibleEditors.pg.sql'); break; case 'oracle': $updater->addExtensionTable('bs_responsible_editors', __DIR__ . '/db/ResponsibleEditors.oci.sql'); break; default: $updater->addExtensionTable('bs_responsible_editors', __DIR__ . '/db/ResponsibleEditors.sql'); } return true; }
/** * Adds the table to the database * @param DatabaseUpdater $updater * @return boolean Always true to keep Hook running */ public static function getSchemaUpdates($updater) { $updater->addExtensionTable('bs_dashboards_configs', __DIR__ . '/db/mysql/bs_dashboards_configs.sql'); return true; }
/** * @param DatabaseUpdater $updater */ public static function onLoadExtensionSchemaUpdates($updater) { $updater->addExtensionTable('opauth_user_profile', __DIR__ . '/schema/opauth_user_profile.sql'); }
public static function onLoadExtensionSchemaUpdates(DatabaseUpdater $updater) { $base = dirname(__FILE__); $db = $updater->addExtensionTable('moderation', "{$base}/../sql/patch-moderation.sql"); $db = $updater->addExtensionTable('moderation_block', "{$base}/../sql/patch-moderation_block.sql"); }
/** * @param DatabaseUpdater $updater * @return bool */ public static function onCreateSchema(DatabaseUpdater $updater) { $updater->addExtensionTable('wbs_propertypairs', __DIR__ . '/sql/create_propertypairs.sql', true); return true; }
/** * Implementation of the hook for loadExtensionSchemaUpdates * * Installs the requisite tables for this extension * * @param DatabaseUpdater $updater * * @return bool */ static function loadExtensionSchemaUpdates(DatabaseUpdater $updater) { $updater->addExtensionTable('accountaudit_login', __DIR__ . '/accountaudit.sql'); $updater->addExtensionField('accountaudit_login', 'aa_method', __DIR__ . '/patches/add_method.sql'); return true; }
/** * Sets up required database tables * @param DatabaseUpdater $updater Provided by MediaWikis update.php * @return boolean Always true to keep the hook running */ public static function getSchemaUpdates($updater) { global $wgDBtype, $wgExtNewTables, $wgExtModifiedFields, $wgExtNewIndexes, $wgExtNewFields; $sDir = __DIR__ . DS; if ($wgDBtype == 'mysql') { $updater->addExtensionTable('bs_review', $sDir . 'db/mysql/review.sql'); $dbr = wfGetDB(DB_SLAVE); if ($dbr->tableExists('bs_review')) { if (!$dbr->fieldExists('bs_review', 'rev_sequential')) { $updater->addExtensionField('bs_review', 'rev_sequential', $sDir . 'db/mysql/review.patch.rev_sequential.sql'); } if (!$dbr->fieldExists('bs_review', 'rev_abortable')) { $updater->addExtensionField('bs_review', 'rev_abortable', $sDir . 'db/mysql/review.patch.rev_abortable.sql'); } } if ($dbr->tableExists('bs_review_steps') && !$dbr->fieldExists('bs_review_steps', 'delegate_to')) { $updater->addExtensionField('bs_review_steps', 'revs_delegate_to', $sDir . 'db/mysql/review.patch.revs_delegate_to.sql'); } if ($dbr->tableExists('bs_review')) { if (!$dbr->fieldExists('bs_review_templates', 'revt_editable')) { $updater->addExtensionField('bs_review_templates', 'revt_editable', $sDir . 'db/mysql/review_templates.patch.revt_editable.sql'); } if (!$dbr->fieldExists('bs_review_templates', 'revt_sequential')) { $updater->addExtensionField('bs_review_templates', 'revt_sequential', $sDir . 'db/mysql/review_templates.patch.revt_sequential.sql'); } if (!$dbr->fieldExists('bs_review_templates', 'revt_abortable')) { $updater->addExtensionField('bs_review_templates', 'revt_abortable', $sDir . 'db/mysql/review_templates.patch.revt_abortable.sql'); } } $updater->modifyExtensionField('bs_review', 'id', $sDir . 'db/mysql/review.patch.id.sql'); $updater->modifyExtensionField('bs_review', 'pid', $sDir . 'db/mysql/review.patch.pid.sql'); $updater->modifyExtensionField('bs_review', 'editable', $sDir . 'db/mysql/review.patch.editable.sql'); $updater->modifyExtensionField('bs_review', 'mode', $sDir . 'db/mysql/review.patch.mode.sql'); $updater->modifyExtensionField('bs_review', 'rev_mode', $sDir . 'db/mysql/review.patch.rev_mode.sql'); $updater->modifyExtensionField('bs_review', 'startdate', $sDir . 'db/mysql/review.patch.startdate.sql'); $updater->modifyExtensionField('bs_review', 'enddate', $sDir . 'db/mysql/review.patch.enddate.sql'); $updater->modifyExtensionField('bs_review', 'owner', $sDir . 'db/mysql/review.patch.owner.sql'); $updater->modifyExtensionField('bs_review_steps', 'id', $sDir . 'db/mysql/review_steps.patch.id.sql'); $updater->modifyExtensionField('bs_review_steps', 'review_id', $sDir . 'db/mysql/review_steps.patch.review_id.sql'); $updater->modifyExtensionField('bs_review_steps', 'user_id', $sDir . 'db/mysql/review_steps.patch.user_id.sql'); $updater->modifyExtensionField('bs_review_steps', 'status', $sDir . 'db/mysql/review_steps.patch.status.sql'); $updater->modifyExtensionField('bs_review_steps', 'sort_id', $sDir . 'db/mysql/review_steps.patch.sort_id.sql'); $updater->modifyExtensionField('bs_review_steps', 'comment', $sDir . 'db/mysql/review_steps.patch.comment.sql'); $updater->modifyExtensionField('bs_review_steps', 'delegate_to', $sDir . 'db/mysql/review_steps.patch.delegate_to.sql'); $updater->modifyExtensionField('bs_review_steps', 'timestamp', $sDir . 'db/mysql/review_steps.patch.timestamp.sql'); $updater->modifyExtensionField('bs_review_steps', 'id', $sDir . 'db/mysql/review_steps.patch.id.sql'); $updater->modifyExtensionField('bs_review_steps', 'review_id', $sDir . 'db/mysql/review_steps.patch.review_id.sql'); $updater->modifyExtensionField('bs_review_steps', 'user_id', $sDir . 'db/mysql/review_steps.patch.user_id.sql'); $updater->modifyExtensionField('bs_review_steps', 'status', $sDir . 'db/mysql/review_steps.patch.status.sql'); $updater->modifyExtensionField('bs_review_steps', 'sort_id', $sDir . 'db/mysql/review_steps.patch.sort_id.sql'); $updater->modifyExtensionField('bs_review_steps', 'comment', $sDir . 'db/mysql/review_steps.patch.comment.sql'); $updater->modifyExtensionField('bs_review_steps', 'delegate_to', $sDir . 'db/mysql/review_steps.patch.delegate_to.sql'); $updater->modifyExtensionField('bs_review_steps', 'timestamp', $sDir . 'db/mysql/review_steps.patch.timestamp.sql'); $updater->modifyExtensionField('bs_review_templates', 'id', $sDir . 'db/mysql/review_templates.patch.id.sql'); $updater->modifyExtensionField('bs_review_templates', 'name', $sDir . 'db/mysql/review_templates.patch.name.sql'); $updater->modifyExtensionField('bs_review_templates', 'owner', $sDir . 'db/mysql/review_templates.patch.owner.sql'); $updater->modifyExtensionField('bs_review_templates', 'user', $sDir . 'db/mysql/review_templates.patch.user.sql'); $updater->modifyExtensionField('bs_review_templates', 'mode', $sDir . 'db/mysql/review_templates.patch.mode.sql'); $updater->modifyExtensionField('bs_review_templates', 'revt_mode', $sDir . 'db/mysql/review_templates.patch.revt_mode.sql'); $updater->modifyExtensionField('bs_review_templates', 'revt_mode', $sDir . 'db/mysql/review_templates.patch.revt_mode.sql'); $updater->modifyExtensionField('bs_review_templates', 'public', $sDir . 'db/mysql/review_templates.patch.public.sql'); } elseif ($wgDBtype == 'postgres') { $wgExtNewTables[] = array('bs_review', $sDir . 'db/postgres/review.pg.sql'); $dbr = wfGetDB(DB_MASTER); if ($dbr->tableExists('bs_review_steps') && !$dbr->fieldExists('bs_review_steps', 'delegate_to') && !$dbr->fieldExists('bs_review_steps', 'revs_delegate_to')) { //PW(25.06.2012) wont work on mw 1.16.5 //$wgExtNewFields[ ] = array( 'bs_review_steps', 'revs_delegate_to', $sDir . 'db/postgres/review.patch.delegate_to.pg.sql' ); $dbr->query("ALTER TABLE " . $dbr->tableName("bs_review_steps") . " ADD revs_delegate_to SMALLINT NOT NULL DEFAULT '0' AFTER revs_comment;"); } $aFieldsToPrefix = array('bs_review' => array('id' => 'rev_id', 'pid' => 'rev_pid', 'editable' => 'rev_editable', 'mode' => 'rev_mode', 'startdate' => 'rev_startdate', 'enddate' => 'rev_enddate', 'owner' => 'rev_owner'), 'bs_review_steps' => array('id' => 'revs_id', 'review_id' => 'revs_review_id', 'user_id' => 'revs_user_id', 'status' => 'revs_status', 'sort_id' => 'revs_sort_id', 'comment' => 'revs_comment', 'delegate_to' => 'revs_delegate_to', 'timestamp' => 'revs_timestamp'), 'bs_review_templates' => array('id' => 'revt_id', 'name' => 'revt_name', 'owner' => 'revt_owner', 'user' => 'revt_user', 'mode' => 'revt_mode', 'public' => 'revt_public')); foreach ($aFieldsToPrefix as $sTable => $aField) { echo $sTable; foreach ($aField as $sOld => $sNew) { if ($dbr->fieldExists($sTable, $sOld)) { if ($sOld == 'user') { $sOld = '"' . $sOld . '"'; } //PW: user is a keyword on modify $dbr->query('ALTER TABLE ' . $dbr->tableName($sTable) . ' RENAME ' . $sOld . ' TO ' . $sNew . ';'); } } } if ($dbr->tableExists('bs_review_steps')) { $dbr->query('ALTER TABLE ONLY ' . $dbr->tableName('bs_review_steps') . ' ALTER COLUMN revs_timestamp set DEFAULT CURRENT_TIMESTAMP'); } $wgExtNewIndexes[] = array('bs_review', 'rev_pid', $sDir . 'db/postgres/review.patch.rev_pid.index.pg.sql'); $wgExtNewIndexes[] = array('bs_review', 'rev_startdate', $sDir . 'db/postgres/review.patch.rev_startdate.index.pg.sql'); $wgExtNewIndexes[] = array('bs_review', 'rev_owner', $sDir . 'db/postgres/review.patch.rev_owner.index.pg.sql'); $wgExtNewIndexes[] = array('bs_review_steps', 'revs_review_id', $sDir . 'db/postgres/review_steps.patch.revs_review_id.index.pg.sql'); $wgExtNewIndexes[] = array('bs_review_steps', 'revs_user_id', $sDir . 'db/postgres/review_steps.patch.revs_user_id.index.pg.sql'); $wgExtNewIndexes[] = array('bs_review_steps', 'revs_status', $sDir . 'db/postgres/review_steps.patch.revs_status.index.pg.sql'); $wgExtNewIndexes[] = array('bs_review_templates', 'revt_owner', $sDir . 'db/postgres/review_templates.patch.revt_owner.index.pg.sql'); $wgExtNewIndexes[] = array('bs_review_templates', 'revt_name', $sDir . 'db/postgres/review_templates.patch.revt_name.index.pg.sql'); } elseif ($wgDBtype == 'oracle') { $wgExtNewTables[] = array('bs_review', $sDir . 'review.oci.sql'); $dbr = wfGetDB(DB_SLAVE); if (!$dbr->fieldExists('bs_review_steps', 'delegate_to')) { $wgExtNewFields[] = array('bs_review_steps', 'revs_delegate_to', $sDir . 'db/oracle/review.patch.revs_delegate_to.oci.sql'); } else { if (!$dbr->fieldExists('bs_review_steps', 'revs_delegate_to')) { $dbr->query('ALTER TABLE ' . $dbr->tableName('bs_review_steps') . ' RENAME COLUMN delegate_to TO revs_delegate_to'); //wont work on linux for NO reason ... //$wgExtModifiedFields[ ] = array( 'bs_review_steps', 'delegate_to', $sDir . 'db/oracle/review_steps.patch.delegate_to.sql' ); } } $wgExtModifiedFields[] = array('bs_review_steps', 'revs_timestamp', $sDir . 'db/oracle/review_steps.patch.revs_timestamp.sql'); $wgExtNewIndexes[] = array('bs_review', 'rev_pid', $sDir . 'db/oracle/review.patch.pid.index.oci.sql'); $wgExtNewIndexes[] = array('bs_review', 'rev_startdate', $sDir . 'db/oracle/review.patch.startdate.index.oci.sql'); $wgExtNewIndexes[] = array('bs_review', 'rev_owner', $sDir . 'db/oracle/review.patch.owner.index.oci.sql'); $wgExtNewIndexes[] = array('bs_review_steps', 'revs_review_id', $sDir . 'db/oracle/review.patch.review_id.index.oci.sql'); $wgExtNewIndexes[] = array('bs_review_steps', 'revs_user_id', $sDir . 'db/oracle/review.patch.user_id.index.oci.sql'); $wgExtNewIndexes[] = array('bs_review_steps', 'revs_status', $sDir . 'db/oracle/review.patch.status.index.oci.sql'); $wgExtNewIndexes[] = array('bs_review_templates', 'revt_name', $sDir . 'db/oracle/review.patch.name.index.oci.sql'); } elseif ($wgDBtype == 'sqlite') { $updater->addExtensionTable('bs_review', $sDir . 'db/mysql/review.sql'); } return true; }