Addshore has uploaded a new change for review.

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


Change subject: Introducing IndexSqlBuilders
......................................................................

Introducing IndexSqlBuilders

Change-Id: I5e9b15462182617f92755debb4baf7178015cdbb
---
A src/MySQL/MySQLIndexSqlBuilde.php
M src/MySQL/MySQLSchemaSqlBuilder.php
A src/SQLite/SQLiteIndexSqlBuilde.php
M src/SQLite/SQLiteSchemaSqlBuilder.php
A src/Schema/IndexSqlBuilder.php
M src/Schema/SchemaModificationSqlBuilder.php
6 files changed, 67 insertions(+), 6 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikibaseDatabase 
refs/changes/54/88054/1

diff --git a/src/MySQL/MySQLIndexSqlBuilde.php 
b/src/MySQL/MySQLIndexSqlBuilde.php
new file mode 100644
index 0000000..4b02de8
--- /dev/null
+++ b/src/MySQL/MySQLIndexSqlBuilde.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace Wikibase\Database\MySQL;
+
+use Wikibase\Database\Schema\Definitions\IndexDefinition;
+use Wikibase\Database\Schema\IndexSqlBuilder;
+
+/**
+ * @since 0.1
+ * @licence GNU GPL v2+
+ * @author Adam Shorland
+ */
+class MySQLIndexSqlBuilder extends IndexSqlBuilder {
+
+       public function getIndexSQL( IndexDefinition $field ){
+               //TODO
+       }
+
+}
\ No newline at end of file
diff --git a/src/MySQL/MySQLSchemaSqlBuilder.php 
b/src/MySQL/MySQLSchemaSqlBuilder.php
index a4f0c94..5db7acc 100644
--- a/src/MySQL/MySQLSchemaSqlBuilder.php
+++ b/src/MySQL/MySQLSchemaSqlBuilder.php
@@ -61,11 +61,11 @@
 
        /**
         * @param string $tableName
-        * @param IndexDefinition $field
+        * @param IndexDefinition $index
         *
         * @return string
         */
-       public function getAddIndexSql( $tableName, IndexDefinition $field ){
+       public function getAddIndexSql( $tableName, IndexDefinition $index ){
                //TODO
        }
 
diff --git a/src/SQLite/SQLiteIndexSqlBuilde.php 
b/src/SQLite/SQLiteIndexSqlBuilde.php
new file mode 100644
index 0000000..598dce0
--- /dev/null
+++ b/src/SQLite/SQLiteIndexSqlBuilde.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace Wikibase\Database\SQLite;
+
+use Wikibase\Database\Schema\Definitions\IndexDefinition;
+use Wikibase\Database\Schema\IndexSqlBuilder;
+
+/**
+ * @since 0.1
+ * @licence GNU GPL v2+
+ * @author Adam Shorland
+ */
+class SQLiteIndexSqlBuilder extends IndexSqlBuilder {
+
+       public function getIndexSQL( IndexDefinition $field ){
+               //TODO
+       }
+
+}
\ No newline at end of file
diff --git a/src/SQLite/SQLiteSchemaSqlBuilder.php 
b/src/SQLite/SQLiteSchemaSqlBuilder.php
index 003091a..4246d41 100644
--- a/src/SQLite/SQLiteSchemaSqlBuilder.php
+++ b/src/SQLite/SQLiteSchemaSqlBuilder.php
@@ -91,11 +91,11 @@
 
        /**
         * @param string $tableName
-        * @param IndexDefinition $field
+        * @param IndexDefinition $index
         *
         * @return string
         */
-       public function getAddIndexSql( $tableName, IndexDefinition $field ){
+       public function getAddIndexSql( $tableName, IndexDefinition $index ){
                //TODO
        }
 
diff --git a/src/Schema/IndexSqlBuilder.php b/src/Schema/IndexSqlBuilder.php
new file mode 100644
index 0000000..b5eb399
--- /dev/null
+++ b/src/Schema/IndexSqlBuilder.php
@@ -0,0 +1,23 @@
+<?php
+
+namespace Wikibase\Database\Schema;
+
+use Wikibase\Database\Schema\Definitions\IndexDefinition;
+
+/**
+ * @since 0.1
+ * @licence GNU GPL v2+
+ * @author Adam Shorland
+ */
+abstract class IndexSqlBuilder {
+
+       /**
+        * @since 0.1
+        *
+        * @param IndexDefinition $field
+        *
+        * @return string The SQL for creating the index
+        */
+       public abstract function getIndexSQL( IndexDefinition $field );
+
+}
\ No newline at end of file
diff --git a/src/Schema/SchemaModificationSqlBuilder.php 
b/src/Schema/SchemaModificationSqlBuilder.php
index bcd23ad..c44e0df 100644
--- a/src/Schema/SchemaModificationSqlBuilder.php
+++ b/src/Schema/SchemaModificationSqlBuilder.php
@@ -38,10 +38,10 @@
 
        /**
         * @param string $tableName
-        * @param IndexDefinition $field
+        * @param IndexDefinition $index
         *
         * @return string
         */
-       public function getAddIndexSql( $tableName, IndexDefinition $field );
+       public function getAddIndexSql( $tableName, IndexDefinition $index );
 
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5e9b15462182617f92755debb4baf7178015cdbb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikibaseDatabase
Gerrit-Branch: master
Gerrit-Owner: Addshore <addshorew...@gmail.com>

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

Reply via email to