mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 08:55:54 +00:00
add method dropTemporaryTable()
This commit is contained in:
parent
8cd08a6f08
commit
1e451529b8
|
@ -661,11 +661,44 @@ class SeedDMS_Core_DatabaseAccess {
|
|||
return false;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Drop various temporary tables to enforce recreation when needed
|
||||
*
|
||||
* @param string $tableName
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function __dropTemporaryTable($tableName) { /* {{{ */
|
||||
$queryStr = '';
|
||||
if (!strcasecmp($tableName, "ttreviewid")) {
|
||||
$queryStr = "DROP TABLE IF EXISTS `ttreviewid`";
|
||||
}
|
||||
elseif (!strcasecmp($tableName, "ttapproveid")) {
|
||||
$queryStr = "DROP TABLE IF EXISTS `ttapproveid`";
|
||||
}
|
||||
elseif (!strcasecmp($tableName, "ttstatid")) {
|
||||
$queryStr = "DROP TABLE IF EXISTS `ttstatid`";
|
||||
}
|
||||
elseif (!strcasecmp($tableName, "ttcontentid")) {
|
||||
$queryStr = "DROP TABLE IF EXISTS `ttcontentid`";
|
||||
}
|
||||
if($queryStr) {
|
||||
if (!$this->getResult($queryStr))
|
||||
return false;
|
||||
else {
|
||||
$this->{'_'.$tableName} = false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Create various views to speed up and simplify sql queries
|
||||
*
|
||||
* @param string $tableName
|
||||
* @param bool $override
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function __createView($tableName, $override=false) { /* {{{ */
|
||||
|
@ -841,6 +874,20 @@ class SeedDMS_Core_DatabaseAccess {
|
|||
return $this->__createTemporaryTable($tableName, $override);
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Drop various temporary tables to force recreation when next time needed
|
||||
*
|
||||
* @param string $tableName
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function dropTemporaryTable($tableName) { /* {{{ */
|
||||
if($this->_useviews)
|
||||
return true; // No need to recreate a view
|
||||
else
|
||||
return $this->__dropTemporaryTable($tableName);
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Return sql statement for extracting the date part from a field
|
||||
* containing a unix timestamp
|
||||
|
|
Loading…
Reference in New Issue
Block a user