diff --git a/code/SQLite3Database.php b/code/SQLite3Database.php index 07942ca..b6cbd9a 100644 --- a/code/SQLite3Database.php +++ b/code/SQLite3Database.php @@ -491,7 +491,7 @@ class SQLite3Database extends Database /** * Fetch the name of the most recent savepoint - * + * * @return string */ protected function getTransactionSavepointName() diff --git a/code/SQLite3SchemaManager.php b/code/SQLite3SchemaManager.php index a993dc7..119085b 100644 --- a/code/SQLite3SchemaManager.php +++ b/code/SQLite3SchemaManager.php @@ -286,7 +286,7 @@ class SQLite3SchemaManager extends DBSchemaManager // Then alter the table column $database = $this->database; - $database->withTransaction(function() use ($database, $queries, $indexList) { + $database->withTransaction(function () use ($database, $queries, $indexList) { foreach ($queries as $query) { $database->query($query . ';'); } @@ -330,7 +330,7 @@ class SQLite3SchemaManager extends DBSchemaManager // Then alter the table column $database = $this->database; - $database->withTransaction(function() use ($database, $queries) { + $database->withTransaction(function () use ($database, $queries) { foreach ($queries as $query) { $database->query($query . ';'); } @@ -431,6 +431,15 @@ class SQLite3SchemaManager extends DBSchemaManager return $this->buildSQLiteIndexName($table, $index); } + protected function convertIndexSpec($indexSpec) + { + $supportedIndexTypes = ['index', 'unique']; + if (isset($indexSpec['type']) && !in_array($indexSpec['type'], $supportedIndexTypes)) { + $indexSpec['type'] = 'index'; + } + return parent::convertIndexSpec($indexSpec); + } + public function indexList($table) { $indexList = array();