mirror of
https://github.com/friendica/friendica
synced 2024-11-19 16:23:40 +00:00
Issue 9975: Remove unused views
This commit is contained in:
parent
1e996af321
commit
bd7e5b69c1
1 changed files with 14 additions and 0 deletions
|
@ -77,6 +77,20 @@ class View
|
|||
|
||||
public static function create(bool $verbose, bool $action)
|
||||
{
|
||||
// Delete previously used views that aren't used anymore
|
||||
foreach(['post-view', 'post-thread-view'] as $view) {
|
||||
if (self::isView($view)) {
|
||||
$sql = sprintf("DROP VIEW IF EXISTS `%s`", DBA::escape($view));
|
||||
if (!empty($sql) && $verbose) {
|
||||
echo $sql . ";\n";
|
||||
}
|
||||
|
||||
if (!empty($sql) && $action) {
|
||||
DBA::e($sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$definition = self::definition();
|
||||
|
||||
foreach ($definition as $name => $structure) {
|
||||
|
|
Loading…
Reference in a new issue