Skip to content

Commit

Permalink
Implementing method in DboSqlite to avoid error while running the tes…
Browse files Browse the repository at this point in the history
…t suite
  • Loading branch information
lorenzo committed Dec 2, 2010
1 parent 2e04c52 commit cdc4cb9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions cake/libs/model/datasources/dbo/dbo_sqlite.php
Expand Up @@ -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.