MINOR: keep SQLiteEnums helper table on clearTable/clearAllData in unit tests

This commit is contained in:
Andreas Piening 2010-04-14 04:01:19 +00:00
parent 5504bf1901
commit bb67ad3cd2

View File

@ -169,7 +169,7 @@ class SQLite3Database extends SS_Database {
* @return string * @return string
*/ */
public function getDatabaseServer() { public function getDatabaseServer() {
return "sqlite"; return "SQLite3";
} }
public function query($sql, $errorLevel = E_USER_ERROR) { public function query($sql, $errorLevel = E_USER_ERROR) {
@ -293,7 +293,7 @@ class SQLite3Database extends SS_Database {
} }
public function clearTable($table) { public function clearTable($table) {
$this->dbConn->query("DELETE FROM \"$table\""); if($table != 'SQLiteEnums') $this->dbConn->query("DELETE FROM \"$table\"");
} }
public function createTable($table, $fields = null, $indexes = null, $options = null, $advancedOptions = null) { public function createTable($table, $fields = null, $indexes = null, $options = null, $advancedOptions = null) {
@ -624,7 +624,6 @@ class SQLite3Database extends SS_Database {
protected $enum_map = array(); protected $enum_map = array();
public function enum($values){ public function enum($values){
$tablefield = $values['table'] . '.' . $values['name']; $tablefield = $values['table'] . '.' . $values['name'];
if(empty($this->enum_map)) $this->query("CREATE TABLE IF NOT EXISTS SQLiteEnums (TableColumn TEXT PRIMARY KEY, EnumList TEXT)"); if(empty($this->enum_map)) $this->query("CREATE TABLE IF NOT EXISTS SQLiteEnums (TableColumn TEXT PRIMARY KEY, EnumList TEXT)");
if(empty($this->enum_map[$tablefield]) || $this->enum_map[$tablefield] != implode(',', $values['enums'])) { if(empty($this->enum_map[$tablefield]) || $this->enum_map[$tablefield] != implode(',', $values['enums'])) {