Version13000Date20170919121250.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016 Joas Schilling <coding@schilljs.com>
  4. *
  5. * @author Joas Schilling <coding@schilljs.com>
  6. * @author Julius Härtl <jus@bitgrid.net>
  7. * @author Morris Jobke <hey@morrisjobke.de>
  8. * @author Roeland Jago Douma <roeland@famdouma.nl>
  9. *
  10. * @license GNU AGPL version 3 or any later version
  11. *
  12. * This program is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU Affero General Public License as
  14. * published by the Free Software Foundation, either version 3 of the
  15. * License, or (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. *
  25. */
  26. namespace OC\Core\Migrations;
  27. use OCP\DB\ISchemaWrapper;
  28. use OCP\Migration\IOutput;
  29. use OCP\Migration\SimpleMigrationStep;
  30. /**
  31. * Auto-generated migration step: Please modify to your needs!
  32. */
  33. class Version13000Date20170919121250 extends SimpleMigrationStep {
  34. /**
  35. * @param IOutput $output
  36. * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  37. * @param array $options
  38. * @since 13.0.0
  39. */
  40. public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
  41. }
  42. /**
  43. * @param IOutput $output
  44. * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  45. * @param array $options
  46. * @return null|ISchemaWrapper
  47. * @since 13.0.0
  48. */
  49. public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
  50. /** @var ISchemaWrapper $schema */
  51. $schema = $schemaClosure();
  52. $table = $schema->getTable('jobs');
  53. $column = $table->getColumn('id');
  54. $column->setUnsigned(true);
  55. $table = $schema->getTable('authtoken');
  56. $column = $table->getColumn('id');
  57. $column->setUnsigned(true);
  58. $column = $table->getColumn('type');
  59. $column->setUnsigned(true);
  60. if ($table->hasColumn('remember')) {
  61. $column = $table->getColumn('remember');
  62. $column->setUnsigned(true);
  63. } else {
  64. $table->addColumn('remember', 'smallint', [
  65. 'notnull' => false,
  66. 'length' => 1,
  67. 'default' => 0,
  68. 'unsigned' => true,
  69. ]);
  70. }
  71. $column = $table->getColumn('last_activity');
  72. $column->setUnsigned(true);
  73. $column = $table->getColumn('last_check');
  74. $column->setUnsigned(true);
  75. $table = $schema->getTable('bruteforce_attempts');
  76. $column = $table->getColumn('id');
  77. $column->setUnsigned(true);
  78. $column = $table->getColumn('occurred');
  79. $column->setUnsigned(true);
  80. $table = $schema->getTable('comments');
  81. $column = $table->getColumn('id');
  82. $column->setUnsigned(true);
  83. $column = $table->getColumn('parent_id');
  84. $column->setUnsigned(true);
  85. $column = $table->getColumn('topmost_parent_id');
  86. $column->setUnsigned(true);
  87. $column = $table->getColumn('children_count');
  88. $column->setUnsigned(true);
  89. $table = $schema->getTable('file_locks');
  90. $column = $table->getColumn('id');
  91. $column->setUnsigned(true);
  92. $table = $schema->getTable('systemtag');
  93. $column = $table->getColumn('id');
  94. $column->setUnsigned(true);
  95. $table = $schema->getTable('systemtag_object_mapping');
  96. $column = $table->getColumn('systemtagid');
  97. $column->setUnsigned(true);
  98. $table = $schema->getTable('systemtag_group');
  99. $column = $table->getColumn('systemtagid');
  100. $column->setUnsigned(true);
  101. $table = $schema->getTable('vcategory');
  102. $column = $table->getColumn('id');
  103. $column->setUnsigned(true);
  104. $table = $schema->getTable('vcategory_to_object');
  105. $column = $table->getColumn('objid');
  106. $column->setUnsigned(true);
  107. $column = $table->getColumn('categoryid');
  108. $column->setUnsigned(true);
  109. return $schema;
  110. }
  111. /**
  112. * @param IOutput $output
  113. * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  114. * @param array $options
  115. * @since 13.0.0
  116. */
  117. public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
  118. }
  119. }