Version13000Date20170919121250.php 3.7 KB

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