12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- declare(strict_types=1);
- namespace OCA\DAV\Migration;
- use Closure;
- use OCP\DB\ISchemaWrapper;
- use OCP\DB\Types;
- use OCP\IDBConnection;
- use OCP\Migration\IOutput;
- use OCP\Migration\SimpleMigrationStep;
- class Version1008Date20181105104826 extends SimpleMigrationStep {
-
- private $connection;
-
- public function __construct(IDBConnection $connection) {
- $this->connection = $connection;
- }
-
- public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
-
- $schema = $schemaClosure();
- $table = $schema->getTable('calendarsubscriptions');
- $table->addColumn('source_copy', Types::TEXT, [
- 'notnull' => false,
- 'length' => null,
- ]);
- return $schema;
- }
-
- public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
- $qb = $this->connection->getQueryBuilder();
- $qb->update('calendarsubscriptions')
- ->set('source_copy', 'source')
- ->execute();
- }
- }
|