1
0

Version1006Date20180619154313.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OCA\DAV\Migration;
  7. use OCP\DB\ISchemaWrapper;
  8. use OCP\DB\Types;
  9. use OCP\Migration\IOutput;
  10. use OCP\Migration\SimpleMigrationStep;
  11. /**
  12. * Auto-generated migration step: Please modify to your needs!
  13. */
  14. class Version1006Date20180619154313 extends SimpleMigrationStep {
  15. /**
  16. * @param IOutput $output
  17. * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  18. * @param array $options
  19. * @return null|ISchemaWrapper
  20. * @since 13.0.0
  21. */
  22. public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
  23. /** @var ISchemaWrapper $schema */
  24. $schema = $schemaClosure();
  25. if (!$schema->hasTable('calendar_invitations')) {
  26. $table = $schema->createTable('calendar_invitations');
  27. $table->addColumn('id', Types::BIGINT, [
  28. 'autoincrement' => true,
  29. 'notnull' => true,
  30. 'length' => 11,
  31. 'unsigned' => true,
  32. ]);
  33. $table->addColumn('uid', Types::STRING, [
  34. 'notnull' => true,
  35. 'length' => 255,
  36. ]);
  37. $table->addColumn('recurrenceid', Types::STRING, [
  38. 'notnull' => false,
  39. 'length' => 255,
  40. ]);
  41. $table->addColumn('attendee', Types::STRING, [
  42. 'notnull' => true,
  43. 'length' => 255,
  44. ]);
  45. $table->addColumn('organizer', Types::STRING, [
  46. 'notnull' => true,
  47. 'length' => 255,
  48. ]);
  49. $table->addColumn('sequence', Types::BIGINT, [
  50. 'notnull' => false,
  51. 'length' => 11,
  52. 'unsigned' => true,
  53. ]);
  54. $table->addColumn('token', Types::STRING, [
  55. 'notnull' => true,
  56. 'length' => 60,
  57. ]);
  58. $table->addColumn('expiration', Types::BIGINT, [
  59. 'notnull' => true,
  60. 'length' => 11,
  61. 'unsigned' => true,
  62. ]);
  63. $table->setPrimaryKey(['id']);
  64. $table->addIndex(['token'], 'calendar_invitation_tokens');
  65. return $schema;
  66. }
  67. }
  68. }