1
0

Version14000Date20180710092004.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2018, Daniel Calviño Sánchez (danxuliu@gmail.com)
  5. *
  6. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  7. * @author Daniel Calviño Sánchez <danxuliu@gmail.com>
  8. * @author Daniel Kesselberg <mail@danielkesselberg.de>
  9. * @author Joas Schilling <coding@schilljs.com>
  10. * @author Roeland Jago Douma <roeland@famdouma.nl>
  11. *
  12. * @license GNU AGPL version 3 or any later version
  13. *
  14. * This program is free software: you can redistribute it and/or modify
  15. * it under the terms of the GNU Affero General Public License as
  16. * published by the Free Software Foundation, either version 3 of the
  17. * License, or (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU Affero General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU Affero General Public License
  25. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  26. *
  27. */
  28. namespace OC\Core\Migrations;
  29. use OCP\DB\Types;
  30. use OCP\DB\ISchemaWrapper;
  31. use OCP\Migration\IOutput;
  32. use OCP\Migration\SimpleMigrationStep;
  33. class Version14000Date20180710092004 extends SimpleMigrationStep {
  34. public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
  35. /** @var ISchemaWrapper $schema */
  36. $schema = $schemaClosure();
  37. $table = $schema->getTable('share');
  38. if (!$table->hasColumn('password_by_talk')) {
  39. $table->addColumn('password_by_talk', Types::BOOLEAN, [
  40. 'default' => 0,
  41. 'notnull' => false,
  42. ]);
  43. }
  44. return $schema;
  45. }
  46. }