Migration: Reset "last preview date" for all bookmarks

Signed-off-by: Marcel Klehr <mklehr@gmx.net>
This commit is contained in:
Marcel Klehr 2021-04-13 14:44:31 +02:00
parent ff1c8d0f83
commit 7f09930c0d
1 changed files with 4 additions and 0 deletions

View File

@ -11,6 +11,7 @@ use Closure;
use Doctrine\DBAL\Schema\SchemaException;
use OCA\Bookmarks\Db\Types;
use OCP\DB\ISchemaWrapper;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
@ -67,5 +68,8 @@ class Version004001000Date20210208124721 extends SimpleMigrationStep {
* @return void
*/
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
// Reset last_preview of all bookmarks to trigger re-visiting them
$qb = $this->db->getQueryBuilder();
$qb->update('bookmarks')->set('last_preview', $qb->createPositionalParameter(0,IQueryBuilder::PARAM_INT))->execute();
}
}