Skip to content

Commit

Permalink
Fix migration to work on first install
Browse files Browse the repository at this point in the history
  • Loading branch information
tomneedham committed Jun 7, 2017
1 parent daaf0dc commit 902ceb0
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions apps/dav/appinfo/Migrations/Version20170526100342.php
Expand Up @@ -19,23 +19,24 @@
*
*/

namespace OCA\dav\Migrations;
namespace OCA\DAV\Migrations;

use OCA\DAV\CalDAV\BirthdayService;
use OCP\IDBConnection;
use OCP\Migration\ISqlMigration;
use OCP\Migration\IOutput;
use OCP\Migration\ISimpleMigration;

/**
* Fix the calendar components of the system contact birthday calendar
*/
class Version20170526100342 implements ISqlMigration {
class Version20170526100342 implements ISimpleMigration {

public function sql(IDBConnection $connection) {
$query = $connection->getQueryBuilder();
public function run(IOutput $out) {
$query = \OC::$server->getDatabaseConnection()->getQueryBuilder();
$updated = $query->update('calendars')
->set('components', $query->createNamedParameter('VEVENT'))
->set('calendarorder', $query->createNamedParameter('100'))
->where($query->expr()->eq('uri', $query->createNamedParameter(BirthdayService::BIRTHDAY_CALENDAR_URI)))
->where($query->expr()->eq(
'uri',
$query->createNamedParameter('contact_birthdays')))
->execute();
}
}

0 comments on commit 902ceb0

Please sign in to comment.