for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace OCA\Analytics\Migration;
use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\IDBConnection;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
/**
* Auto-generated migration step: Please modify to your needs!
* sudo -u www-data php /var/www/nextcloud/occ migrations:execute analytics 4009Date20230410190000
*/
class Version4009Date20230410190000 extends SimpleMigrationStep
{
/** @var IDBConnection */
private $connection;
public function __construct(IDBConnection $connection)
$this->connection = $connection;
}
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @param array $options
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options)
* @return null|ISchemaWrapper
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options)
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options)
$query = $this->connection->getQueryBuilder();
$query->delete('analytics_share')
->where($query->expr()->isNotNull('parent'))
->executeStatement();