-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Calendarsubscriptions source column change on Oracle
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
- Loading branch information
1 parent
b56cb41
commit b6e6308
Showing
9 changed files
with
195 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OCA\DAV\Migration; | ||
|
||
|
||
use Closure; | ||
use Doctrine\DBAL\Types\Type; | ||
use OCP\DB\ISchemaWrapper; | ||
use OCP\IDBConnection; | ||
use OCP\Migration\SimpleMigrationStep; | ||
use OCP\Migration\IOutput; | ||
|
||
/** | ||
* Auto-generated migration step: Please modify to your needs! | ||
*/ | ||
class Version1008Date20181105104826 extends SimpleMigrationStep { | ||
|
||
/** @var IDBConnection */ | ||
private $connection; | ||
|
||
/** | ||
* Version1007Date20181007225117 constructor. | ||
* | ||
* @param IDBConnection $connection | ||
*/ | ||
public function __construct(IDBConnection $connection) { | ||
$this->connection = $connection; | ||
} | ||
|
||
/** | ||
* @param IOutput $output | ||
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` | ||
* @param array $options | ||
* @return null|ISchemaWrapper | ||
*/ | ||
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { | ||
/** @var ISchemaWrapper $schema */ | ||
$schema = $schemaClosure(); | ||
$table = $schema->getTable('calendarsubscriptions'); | ||
|
||
$table->addColumn('source_copy', Type::TEXT, [ | ||
'notnull' => false, | ||
'length' => null, | ||
]); | ||
|
||
return $schema; | ||
} | ||
|
||
/** | ||
* @param IOutput $output | ||
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` | ||
* @param array $options | ||
*/ | ||
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) { | ||
$qb = $this->connection->getQueryBuilder(); | ||
$qb->update('calendarsubscriptions') | ||
->set('source_copy', 'source') | ||
->execute(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OCA\DAV\Migration; | ||
|
||
use Closure; | ||
use OCP\DB\ISchemaWrapper; | ||
use OCP\Migration\SimpleMigrationStep; | ||
use OCP\Migration\IOutput; | ||
|
||
/** | ||
* Auto-generated migration step: Please modify to your needs! | ||
*/ | ||
class Version1008Date20181105104833 extends SimpleMigrationStep { | ||
|
||
/** | ||
* @param IOutput $output | ||
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` | ||
* @param array $options | ||
* @return null|ISchemaWrapper | ||
*/ | ||
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { | ||
/** @var ISchemaWrapper $schema */ | ||
$schema = $schemaClosure(); | ||
$table = $schema->getTable('calendarsubscriptions'); | ||
$table->dropColumn('source'); | ||
|
||
return $schema; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OCA\DAV\Migration; | ||
|
||
use Closure; | ||
use Doctrine\DBAL\Types\Type; | ||
use OCP\DB\ISchemaWrapper; | ||
use OCP\IDBConnection; | ||
use OCP\Migration\SimpleMigrationStep; | ||
use OCP\Migration\IOutput; | ||
|
||
/** | ||
* Auto-generated migration step: Please modify to your needs! | ||
*/ | ||
class Version1008Date20181105110300 extends SimpleMigrationStep { | ||
|
||
/** @var IDBConnection */ | ||
private $connection; | ||
|
||
/** | ||
* Version1007Date20181007225117 constructor. | ||
* | ||
* @param IDBConnection $connection | ||
*/ | ||
public function __construct(IDBConnection $connection) { | ||
$this->connection = $connection; | ||
} | ||
|
||
/** | ||
* @param IOutput $output | ||
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` | ||
* @param array $options | ||
* @return null|ISchemaWrapper | ||
*/ | ||
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { | ||
/** @var ISchemaWrapper $schema */ | ||
$schema = $schemaClosure(); | ||
$table = $schema->getTable('calendarsubscriptions'); | ||
$table->addColumn('source', Type::TEXT, [ | ||
'notnull' => false, | ||
'length' => null, | ||
]); | ||
|
||
return $schema; | ||
} | ||
|
||
/** | ||
* @param IOutput $output | ||
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` | ||
* @param array $options | ||
*/ | ||
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) { | ||
$qb = $this->connection->getQueryBuilder(); | ||
$qb->update('calendarsubscriptions') | ||
->set('source', 'source_copy') | ||
->execute(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OCA\DAV\Migration; | ||
|
||
use Closure; | ||
use OCP\DB\ISchemaWrapper; | ||
use OCP\Migration\SimpleMigrationStep; | ||
use OCP\Migration\IOutput; | ||
|
||
/** | ||
* Auto-generated migration step: Please modify to your needs! | ||
*/ | ||
class Version1008Date20181105112049 extends SimpleMigrationStep { | ||
|
||
/** | ||
* @param IOutput $output | ||
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` | ||
* @param array $options | ||
* @return null|ISchemaWrapper | ||
*/ | ||
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { | ||
/** @var ISchemaWrapper $schema */ | ||
$schema = $schemaClosure(); | ||
$table = $schema->getTable('calendarsubscriptions'); | ||
$table->dropColumn('source_copy'); | ||
|
||
return $schema; | ||
} | ||
} |