Skip to content
Permalink
Browse files

Implementing method in DboSqlite to avoid error while running the tes…

…t suite
  • Loading branch information...
lorenzo committed Dec 2, 2010
1 parent 2e04c52 commit cdc4cb9e1ede9b584ac6fbee40ee85cfa1d30084
Showing with 18 additions and 0 deletions.
  1. +18 −0 cake/libs/model/datasources/dbo/dbo_sqlite.php
@@ -528,4 +528,22 @@ function renderStatement($type, $data) {
function hasResult() {
return is_object($this->_result);
}
/**
* Generate a "drop table" statement for the given Schema object
*
* @param object $schema An instance of a subclass of CakeSchema
* @param string $table Optional. If specified only the table name given will be generated.
* Otherwise, all tables defined in the schema are generated.
* @return string
*/
public function dropSchema(CakeSchema $schema, $table = null) {
$out = '';
foreach ($schema->tables as $curTable => $columns) {
if (!$table || $table == $curTable) {
$out .= 'DROP TABLE IF EXISTS ' . $this->fullTableName($curTable) . ";\n";
}
}
return $out;
}
}

0 comments on commit cdc4cb9

Please sign in to comment.
You can’t perform that action at this time.