1
0

Version1006Date20180619154313.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016 Georg Ehrke <oc.list@georgehrke.com>
  4. *
  5. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  6. * @author Daniel Kesselberg <mail@danielkesselberg.de>
  7. * @author Georg Ehrke <oc.list@georgehrke.com>
  8. * @author Joas Schilling <coding@schilljs.com>
  9. * @author Roeland Jago Douma <roeland@famdouma.nl>
  10. *
  11. * @license GNU AGPL version 3 or any later version
  12. *
  13. * This program is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License as
  15. * published by the Free Software Foundation, either version 3 of the
  16. * License, or (at your option) any later version.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU Affero General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Affero General Public License
  24. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  25. *
  26. */
  27. namespace OCA\DAV\Migration;
  28. use OCP\DB\Types;
  29. use OCP\DB\ISchemaWrapper;
  30. use OCP\Migration\IOutput;
  31. use OCP\Migration\SimpleMigrationStep;
  32. /**
  33. * Auto-generated migration step: Please modify to your needs!
  34. */
  35. class Version1006Date20180619154313 extends SimpleMigrationStep {
  36. /**
  37. * @param IOutput $output
  38. * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  39. * @param array $options
  40. * @return null|ISchemaWrapper
  41. * @since 13.0.0
  42. */
  43. public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
  44. /** @var ISchemaWrapper $schema */
  45. $schema = $schemaClosure();
  46. if (!$schema->hasTable('calendar_invitations')) {
  47. $table = $schema->createTable('calendar_invitations');
  48. $table->addColumn('id', Types::BIGINT, [
  49. 'autoincrement' => true,
  50. 'notnull' => true,
  51. 'length' => 11,
  52. 'unsigned' => true,
  53. ]);
  54. $table->addColumn('uid', Types::STRING, [
  55. 'notnull' => true,
  56. 'length' => 255,
  57. ]);
  58. $table->addColumn('recurrenceid', Types::STRING, [
  59. 'notnull' => false,
  60. 'length' => 255,
  61. ]);
  62. $table->addColumn('attendee', Types::STRING, [
  63. 'notnull' => true,
  64. 'length' => 255,
  65. ]);
  66. $table->addColumn('organizer', Types::STRING, [
  67. 'notnull' => true,
  68. 'length' => 255,
  69. ]);
  70. $table->addColumn('sequence', Types::BIGINT, [
  71. 'notnull' => false,
  72. 'length' => 11,
  73. 'unsigned' => true,
  74. ]);
  75. $table->addColumn('token', Types::STRING, [
  76. 'notnull' => true,
  77. 'length' => 60,
  78. ]);
  79. $table->addColumn('expiration', Types::BIGINT, [
  80. 'notnull' => true,
  81. 'length' => 11,
  82. 'unsigned' => true,
  83. ]);
  84. $table->setPrimaryKey(['id']);
  85. $table->addIndex(['token'], 'calendar_invitation_tokens');
  86. return $schema;
  87. }
  88. }
  89. }