Commit 67985484 authored by Benjamin Eberlei's avatar Benjamin Eberlei

DDC-1502 - Add support for prefixed database table names in SQLite by replacing the . with __

parent e692ab66
......@@ -291,6 +291,7 @@ class SqlitePlatform extends AbstractPlatform
*/
protected function _getCreateTableSQL($name, array $columns, array $options = array())
{
$name = str_replace(".", "__", $name);
$queryFields = $this->getColumnDeclarationListSQL($columns);
$autoinc = false;
......@@ -338,16 +339,19 @@ class SqlitePlatform extends AbstractPlatform
public function getListTableConstraintsSQL($table)
{
$table = str_replace(".", "__", $table);
return "SELECT sql FROM sqlite_master WHERE type='index' AND tbl_name = '$table' AND sql NOT NULL ORDER BY name";
}
public function getListTableColumnsSQL($table, $currentDatabase = null)
{
$table = str_replace(".", "__", $table);
return "PRAGMA table_info($table)";
}
public function getListTableIndexesSQL($table, $currentDatabase = null)
{
$table = str_replace(".", "__", $table);
return "PRAGMA index_list($table)";
}
......@@ -411,6 +415,7 @@ class SqlitePlatform extends AbstractPlatform
*/
public function getTruncateTableSQL($tableName, $cascade = false)
{
$tableName = str_replace(".", "__", $tableName);
return 'DELETE FROM '.$tableName;
}
......@@ -500,4 +505,10 @@ class SqlitePlatform extends AbstractPlatform
{
return 'BLOB';
}
public function getTemporaryTableName($tableName)
{
$tableName = str_replace(".", "__", $tableName);
return $tableName;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment