-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sean Molenaar <[email protected]>
- Loading branch information
1 parent
5c7838e
commit 415370d
Showing
11 changed files
with
169 additions
and
77 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,8 @@ | |
* [Robin Appelman](mailto:[email protected]) | ||
* [Sean Molenaar](mailto:[email protected]) | ||
* [Gregor Tätzner](mailto:[email protected]) | ||
* [Morris Jobke](mailto:[email protected]) | ||
* [Sean Molenaar](mailto:[email protected]) | ||
* [Morris Jobke](mailto:[email protected]) | ||
* [anoy](mailto:[email protected]) | ||
* [Jan-Christoph Borchardt](mailto:[email protected]) | ||
* [Daniel Schaal](mailto:[email protected]) | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace OCA\News\Migration; | ||
|
||
use Closure; | ||
use OCP\DB\ISchemaWrapper; | ||
use OCP\Migration\IOutput; | ||
use OCP\Migration\SimpleMigrationStep; | ||
use function PHPUnit\Framework\returnValue; | ||
|
||
/** | ||
* Auto-generated migration step: Please modify to your needs! | ||
*/ | ||
class Version150203Date20210204203051 extends SimpleMigrationStep { | ||
|
||
/** | ||
* @param IOutput $output | ||
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` | ||
* @param array $options | ||
*/ | ||
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void { | ||
} | ||
|
||
/** | ||
* @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): ?ISchemaWrapper { | ||
/** @var ISchemaWrapper $schema */ | ||
$schema = $schemaClosure(); | ||
|
||
if ($schema->hasTable('news_items') && | ||
$schema->getTable('news_items')->hasColumn('last_modified') && | ||
$schema->getTable('news_items')->getColumn('last_modified')->getUnsigned() | ||
) { | ||
$schema->getTable('news_items') | ||
->getColumn('last_modified') | ||
->setUnsigned(false); | ||
} | ||
|
||
if ($schema->hasTable('news_items') && | ||
$schema->getTable('news_items')->hasColumn('updated_date') | ||
) { | ||
$schema->getTable('news_items') | ||
->dropColumn('updated_date'); | ||
} | ||
|
||
if ($schema->hasTable('news_items') && | ||
$schema->getTable('news_items')->hasColumn('status') | ||
) { | ||
$schema->getTable('news_items') | ||
->dropColumn('status'); | ||
} | ||
|
||
if ($schema->hasTable('news_feeds') && | ||
$schema->getTable('news_feeds')->hasColumn('http_etag') | ||
) { | ||
$schema->getTable('news_feeds') | ||
->dropColumn('http_etag'); | ||
} | ||
|
||
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): void { | ||
} | ||
} |
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
Oops, something went wrong.