Page MenuHomePhabricator

Cargo not creating tables with MS SQLServer database
Closed, ResolvedPublic

Description

When attempting to install CARGO on a SQL Server based MEDIAWIKI installation, I encountered some installation errors documented below. I know this should not be a surprise, since CARGO is not guaranteed to work with SQL Server. I am stuck with SQL Server, and I would really like to use the CARGO extensions on MediaWiki. I am hoping that somebody could look into this and provide some feedback if it is feasible to provide a fix for this.

Mediawiki: 1.27.1
PHP: 5.6.29 (cgi-fcgi)
MS SQL Server 10.50.1600 (Server 2008 R2)

Attempting to install the Cargo extension, I have encountered the following problem. The database tables never get created by the maintenance script. I have used the following process to install the Cargo extension:
Place the Cargo directory in the extension directory.
added this line to the localsettings.php file:

"require_once( "$IP/extensions/Cargo/Cargo.php" );

Then run PHP update.php from the command line in the maintenance directory.
Update completes with no errors.

Checking the database, I find that no Cargo tables were created.
Although, checking the Special Versions page, it does show that Cargo is installed. Navagating to the Special Cargo pages causes a fatal error.

I have also tried to install using the command:
wfLoadExtension( 'Cargo' );
in the localsetting.php file with the same results, no tables created after running the update.php.

Lastly, I have tried to manually create the two Cargo tables in the database and test Cargo functionality, but received a fatal web error.

Event Timeline

The extension doesn't have SQL Server support

	public static function describeDBSchema( DatabaseUpdater $updater ) {
		// DB updates
		// For now, there's just a single SQL file for all DB types.

		if ( $updater->getDB()->getType() == 'mysql' || $updater->getDB()->getType() == 'sqlite' ) {
			$updater->addExtensionTable( 'cargo_tables', __DIR__ . "/sql/Cargo.sql" );
			$updater->addExtensionTable( 'cargo_pages', __DIR__ . "/sql/Cargo.sql" );
		} elseif ( $updater->getDB()->getType() == 'postgres' ) {
			$updater->addExtensionUpdate( array( 'addTable', 'cargo_tables', __DIR__ . "/sql/Cargo.pg.sql", true ) );
			$updater->addExtensionUpdate( array( 'addTable', 'cargo_pages', __DIR__ . "/sql/Cargo.pg.sql", true ) );
		}
		return true;
	}
Yaron_Koren renamed this task from MediaWiki-extensions-Cargo not creating tables to Cargo not creating tables with MS SQLServer database.Jan 13 2017, 10:07 PM

Change 332004 had a related patch set (by Paladox) published:
Add support for Microsoft SQL Server

https://gerrit.wikimedia.org/r/332004

Change 332004 merged by Yaron Koren:
Add support for Microsoft SQL Server

https://gerrit.wikimedia.org/r/332004

Yaron_Koren claimed this task.
Yaron_Koren subscribed.

I think this was fixed a while ago.