Added method to delete DB namespace
This commit is contained in:
parent
2d0ace7cd5
commit
141e88898a
|
@ -391,6 +391,9 @@ $utopia->delete('/v1/projects/:projectId')
|
|||
throw new Exception('Failed to remove project from DB', 500);
|
||||
}
|
||||
|
||||
// Delete all DBs
|
||||
$consoleDB->deleteNamespace($project->getUid());
|
||||
|
||||
$response->noContent();
|
||||
}
|
||||
);
|
||||
|
|
|
@ -88,6 +88,14 @@ abstract class Adapter
|
|||
*/
|
||||
abstract public function createNamespace($namespace);
|
||||
|
||||
/**
|
||||
* Delete Namespace
|
||||
*
|
||||
* @param string $namespace
|
||||
* @return bool
|
||||
*/
|
||||
abstract public function deleteNamespace($namespace);
|
||||
|
||||
/**
|
||||
* Filter
|
||||
*
|
||||
|
|
|
@ -154,6 +154,17 @@ class Redis extends Adapter
|
|||
return $this->adapter->createNamespace($namespace);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Namespace
|
||||
*
|
||||
* @param string $namespace
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteNamespace($namespace)
|
||||
{
|
||||
return $this->adapter->deleteNamespace($namespace);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $options
|
||||
* @return array
|
||||
|
|
|
@ -95,6 +95,17 @@ class Database
|
|||
return $this->adapter->createNamespace($namespace);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Namespace
|
||||
*
|
||||
* @param int $namespace
|
||||
* @return bool
|
||||
*/
|
||||
public function deleteNamespace($namespace)
|
||||
{
|
||||
return $this->adapter->deleteNamespace($namespace);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $options
|
||||
* @return Document[]|Document
|
||||
|
|
Loading…
Reference in a new issue