-
Notifications
You must be signed in to change notification settings - Fork 83
Consolidate and fix migration #425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
94aec63
Added default 0 to' vote_option_id'
dartcafe 45bb9ee
Removed unused code and consolidated migrations
dartcafe 9eecf74
Fixes an namechage of migration
dartcafe 739f946
fix
dartcafe a665cfa
Beleive in migration. :-)
dartcafe e233b46
nitpicker fix :-)
dartcafe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next
Next commit
Added default 0 to' vote_option_id'
- Loading branch information
commit 94aec63031b3c5bbb9167f57e58b87974e7da6d2
There are no files selected for viewing
This file contains hidden or 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,69 @@ | ||
| <?php | ||
| namespace OCA\Polls\Migration; | ||
|
|
||
| use Doctrine\DBAL\Exception\TableNotFoundException; | ||
| use Doctrine\DBAL\Platforms\PostgreSqlPlatform; | ||
| use Doctrine\DBAL\Types\Type; | ||
| use OCP\DB\ISchemaWrapper; | ||
| use OCP\IDBConnection; | ||
| use OCP\IConfig; | ||
| use OCP\Migration\SimpleMigrationStep; | ||
| use OCP\Migration\IOutput; | ||
|
|
||
| /** | ||
| * Adding timestamp to options table | ||
| */ | ||
| class Version009000Date20181116063745 extends SimpleMigrationStep { | ||
| /** @var IDBConnection */ | ||
| protected $connection; | ||
|
|
||
| /** @var IConfig */ | ||
| protected $config; | ||
dartcafe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| /** | ||
| * @param IDBConnection $connection | ||
| * @param IConfig $config | ||
| */ | ||
| public function __construct(IDBConnection $connection, IConfig $config) { | ||
dartcafe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| $this->connection = $connection; | ||
| $this->config = $config; | ||
| } | ||
| /** | ||
| * @param IOutput $output | ||
| * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` | ||
| * @param array $options | ||
| * @since 13.0.0 | ||
| */ | ||
| public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) { | ||
dartcafe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| /** | ||
| * @param IOutput $output | ||
| * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` | ||
| * @param array $options | ||
| * @return null|ISchemaWrapper | ||
| * @since 13.0.0 | ||
| */ | ||
| public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { | ||
| /** @var ISchemaWrapper $schema */ | ||
| $schema = $schemaClosure(); | ||
|
|
||
| if ($schema->hasTable('polls_votes')) { | ||
| $table = $schema->getTable('polls_votes'); | ||
| $table->changeColumn('vote_option_id', [ | ||
| 'notnull' => false, | ||
| 'default' => 0 | ||
| ]); | ||
| } | ||
| return $schema; | ||
| } | ||
|
|
||
| /** | ||
| * @param IOutput $output | ||
| * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` | ||
| * @param array $options | ||
| * @since 13.0.0 | ||
| */ | ||
| public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) { | ||
dartcafe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.