DropAccountTermsTable.php 773 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OC\Repair\Owncloud;
  7. use OCP\IDBConnection;
  8. use OCP\Migration\IOutput;
  9. use OCP\Migration\IRepairStep;
  10. class DropAccountTermsTable implements IRepairStep {
  11. /** @var IDBConnection */
  12. protected $db;
  13. /**
  14. * @param IDBConnection $db
  15. */
  16. public function __construct(IDBConnection $db) {
  17. $this->db = $db;
  18. }
  19. /**
  20. * @return string
  21. */
  22. public function getName() {
  23. return 'Drop account terms table when migrating from ownCloud';
  24. }
  25. /**
  26. * @param IOutput $output
  27. */
  28. public function run(IOutput $output) {
  29. if (!$this->db->tableExists('account_terms')) {
  30. return;
  31. }
  32. $this->db->dropTable('account_terms');
  33. }
  34. }