Version13000Date20170919121250.php 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OC\Core\Migrations;
  7. use OCP\DB\ISchemaWrapper;
  8. use OCP\Migration\IOutput;
  9. use OCP\Migration\SimpleMigrationStep;
  10. /**
  11. * Auto-generated migration step: Please modify to your needs!
  12. */
  13. class Version13000Date20170919121250 extends SimpleMigrationStep {
  14. /**
  15. * @param IOutput $output
  16. * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  17. * @param array $options
  18. * @since 13.0.0
  19. */
  20. public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
  21. }
  22. /**
  23. * @param IOutput $output
  24. * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  25. * @param array $options
  26. * @return null|ISchemaWrapper
  27. * @since 13.0.0
  28. */
  29. public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
  30. /** @var ISchemaWrapper $schema */
  31. $schema = $schemaClosure();
  32. $table = $schema->getTable('jobs');
  33. $column = $table->getColumn('id');
  34. $column->setUnsigned(true);
  35. $table = $schema->getTable('authtoken');
  36. $column = $table->getColumn('id');
  37. $column->setUnsigned(true);
  38. $column = $table->getColumn('type');
  39. $column->setUnsigned(true);
  40. if ($table->hasColumn('remember')) {
  41. $column = $table->getColumn('remember');
  42. $column->setUnsigned(true);
  43. } else {
  44. $table->addColumn('remember', 'smallint', [
  45. 'notnull' => false,
  46. 'length' => 1,
  47. 'default' => 0,
  48. 'unsigned' => true,
  49. ]);
  50. }
  51. $column = $table->getColumn('last_activity');
  52. $column->setUnsigned(true);
  53. $column = $table->getColumn('last_check');
  54. $column->setUnsigned(true);
  55. $table = $schema->getTable('bruteforce_attempts');
  56. $column = $table->getColumn('id');
  57. $column->setUnsigned(true);
  58. $column = $table->getColumn('occurred');
  59. $column->setUnsigned(true);
  60. $table = $schema->getTable('comments');
  61. $column = $table->getColumn('id');
  62. $column->setUnsigned(true);
  63. $column = $table->getColumn('parent_id');
  64. $column->setUnsigned(true);
  65. $column = $table->getColumn('topmost_parent_id');
  66. $column->setUnsigned(true);
  67. $column = $table->getColumn('children_count');
  68. $column->setUnsigned(true);
  69. $table = $schema->getTable('file_locks');
  70. $column = $table->getColumn('id');
  71. $column->setUnsigned(true);
  72. $table = $schema->getTable('systemtag');
  73. $column = $table->getColumn('id');
  74. $column->setUnsigned(true);
  75. $table = $schema->getTable('systemtag_object_mapping');
  76. $column = $table->getColumn('systemtagid');
  77. $column->setUnsigned(true);
  78. $table = $schema->getTable('systemtag_group');
  79. $column = $table->getColumn('systemtagid');
  80. $column->setUnsigned(true);
  81. $table = $schema->getTable('vcategory');
  82. $column = $table->getColumn('id');
  83. $column->setUnsigned(true);
  84. $table = $schema->getTable('vcategory_to_object');
  85. $column = $table->getColumn('objid');
  86. $column->setUnsigned(true);
  87. $column = $table->getColumn('categoryid');
  88. $column->setUnsigned(true);
  89. return $schema;
  90. }
  91. /**
  92. * @param IOutput $output
  93. * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  94. * @param array $options
  95. * @since 13.0.0
  96. */
  97. public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
  98. }
  99. }