Version14000Date20180129121024.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2018 Joas Schilling <coding@schilljs.com>
  4. *
  5. * @author Joas Schilling <coding@schilljs.com>
  6. * @author Robin Appelman <robin@icewind.nl>
  7. * @author Roeland Jago Douma <roeland@famdouma.nl>
  8. *
  9. * @license GNU AGPL version 3 or any later version
  10. *
  11. * This program is free software: you can redistribute it and/or modify
  12. * it under the terms of the GNU Affero General Public License as
  13. * published by the Free Software Foundation, either version 3 of the
  14. * License, or (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU Affero General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU Affero General Public License
  22. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  23. *
  24. */
  25. namespace OC\Core\Migrations;
  26. use OCP\DB\ISchemaWrapper;
  27. use OCP\Migration\IOutput;
  28. use OCP\Migration\SimpleMigrationStep;
  29. /**
  30. * Delete the admin|personal sections and settings tables
  31. */
  32. class Version14000Date20180129121024 extends SimpleMigrationStep {
  33. public function name(): string {
  34. return 'Drop obsolete settings tables';
  35. }
  36. public function description(): string {
  37. return 'Drops the following obsolete tables: "admin_sections", "admin_settings", "personal_sections" and "personal_settings"';
  38. }
  39. /**
  40. * @param IOutput $output
  41. * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  42. * @param array $options
  43. * @return null|ISchemaWrapper
  44. * @since 13.0.0
  45. */
  46. public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
  47. /** @var ISchemaWrapper $schema */
  48. $schema = $schemaClosure();
  49. $schema->dropTable('admin_sections');
  50. $schema->dropTable('admin_settings');
  51. $schema->dropTable('personal_sections');
  52. $schema->dropTable('personal_settings');
  53. return $schema;
  54. }
  55. }