| @@ 104-118 (lines=15) @@ | ||
| 101 | * |
|
| 102 | * @return array<integer,mixed|string> 0 if operation was successful |
|
| 103 | */ |
|
| 104 | public function dropIndex($index, $cascade) |
|
| 105 | { |
|
| 106 | $f_schema = $this->_schema; |
|
| 107 | $this->fieldClean($f_schema); |
|
| 108 | $this->fieldClean($index); |
|
| 109 | ||
| 110 | $sql = "DROP INDEX \"{$f_schema}\".\"{$index}\""; |
|
| 111 | if ($cascade) { |
|
| 112 | $sql .= ' CASCADE'; |
|
| 113 | } |
|
| 114 | ||
| 115 | $status = $this->execute($sql); |
|
| 116 | ||
| 117 | return [$status, $sql]; |
|
| 118 | } |
|
| 119 | ||
| 120 | /** |
|
| 121 | * Rebuild indexes. |
|
| @@ 1240-1254 (lines=15) @@ | ||
| 1237 | * |
|
| 1238 | * @return array<integer,mixed|string> 0 if operation was successful |
|
| 1239 | */ |
|
| 1240 | public function emptyTable($table, $cascade) |
|
| 1241 | { |
|
| 1242 | $f_schema = $this->_schema; |
|
| 1243 | $this->fieldClean($f_schema); |
|
| 1244 | $this->fieldClean($table); |
|
| 1245 | ||
| 1246 | $sql = "TRUNCATE TABLE \"{$f_schema}\".\"{$table}\" "; |
|
| 1247 | if ($cascade) { |
|
| 1248 | $sql = $sql.' CASCADE'; |
|
| 1249 | } |
|
| 1250 | ||
| 1251 | $status = $this->execute($sql); |
|
| 1252 | ||
| 1253 | return [$status, $sql]; |
|
| 1254 | } |
|
| 1255 | ||
| 1256 | /** |
|
| 1257 | * Removes a table from the database. |
|