Yaron Koren has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/332004 )

Change subject: Add support for Microsoft SQL Server
......................................................................


Add support for Microsoft SQL Server

Bug: T155260
Change-Id: If538df3e7af61485547f6abbc7eeeb9f762b4dad
---
M Cargo.hooks.php
A sql/Cargo.mssql.sql
2 files changed, 21 insertions(+), 0 deletions(-)

Approvals:
  Yaron Koren: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Cargo.hooks.php b/Cargo.hooks.php
index e2053d6..04ecde6 100755
--- a/Cargo.hooks.php
+++ b/Cargo.hooks.php
@@ -294,6 +294,9 @@
                } 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 ) );
+               } elseif ( $updater->getDB()->getType() == 'mssql' ) {
+                       $updater->addExtensionUpdate( array( 'addTable', 
'cargo_tables', __DIR__ . "/sql/Cargo.mssql.sql", true ) );
+                       $updater->addExtensionUpdate( array( 'addTable', 
'cargo_pages', __DIR__ . "/sql/Cargo.mssql.sql", true ) );
                }
                return true;
        }
diff --git a/sql/Cargo.mssql.sql b/sql/Cargo.mssql.sql
new file mode 100644
index 0000000..df29c77
--- /dev/null
+++ b/sql/Cargo.mssql.sql
@@ -0,0 +1,18 @@
+-- Microsoft SQL Server schema for Cargo extension
+
+CREATE TABLE /*_*/cargo_tables (
+       template_id int NOT NULL,
+       main_table varchar(200) NOT NULL,
+       field_tables varchar(max) NOT NULL,
+       table_schema varchar(max) NOT NULL
+) /*$wgDBTableOptions*/;
+
+CREATE UNIQUE INDEX cargo_tables_template_id ON /*_*/cargo_tables 
(template_id);
+CREATE UNIQUE INDEX cargo_tables_main_table ON /*_*/cargo_tables (main_table);
+
+CREATE TABLE /*_*/cargo_pages (
+       page_id int NOT NULL,
+       table_name varchar(200) NOT NULL
+) /*$wgDBTableOptions*/;
+
+CREATE INDEX cargo_pages_page_id ON /*_*/cargo_pages (page_id);

-- 
To view, visit https://gerrit.wikimedia.org/r/332004
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If538df3e7af61485547f6abbc7eeeb9f762b4dad
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/Cargo
Gerrit-Branch: master
Gerrit-Owner: Paladox <thomasmulhall...@yahoo.com>
Gerrit-Reviewer: Yaron Koren <yaro...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to