Migration feature#65
Merged
Merged
Conversation
added 24 commits
January 31, 2022 01:06
Moving Table related classes to new Schema folder, Adding doc-blocks for all properties, constants and methods, Correcting unit tests
andrey-smaelov
requested changes
May 18, 2022
andrey-smaelov
left a comment
Collaborator
There was a problem hiding this comment.
Please check comments and apply changes
| class MigrationException extends \Exception | ||
| { | ||
|
|
||
| const WRONG_MIGRATION_DIRECTION = 'Migration direction can only be [up] or [down]'; |
Collaborator
There was a problem hiding this comment.
Missing doc-block comments for constants
| */ | ||
| public function rename(string $oldName, string $newName): bool | ||
| { | ||
| $this->get($oldName)->setAction(Table::RENAME, ['newName' => $newName]); |
Collaborator
There was a problem hiding this comment.
The action can be passed to $this->get() as second argument
| */ | ||
| public function drop(string $name): bool | ||
| { | ||
| $this->get($name)->setAction(Table::DROP); |
Collaborator
There was a problem hiding this comment.
The action can be passed to $this->get() as second argument
|
|
||
| use Quantum\Migration\QtMigration; | ||
| use Quantum\Factory\TableFactory; | ||
| use Quantum\Libraries\Database\Type; |
Collaborator
There was a problem hiding this comment.
The Type class import path is not correct
…d adding doc-blocks
andrey-smaelov
approved these changes
May 18, 2022
Vahram1995
reviewed
May 18, 2022
|
|
||
| try { | ||
| $migrated = $migrationManager->applyMigrations($direction, $step); | ||
| $this->info($migrated . ' migration' . ($migrated > 1 ? 's' : '') . ' ' . ($migrated > 1 ? 'were' : 'was') . ' applied'); |
Collaborator
There was a problem hiding this comment.
can be checked with one condition
Vahram1995
reviewed
May 18, 2022
| */ | ||
| public function get(string $property, string $action = null) | ||
| { | ||
| return isset($this->$property) && ($action != self::RENAME && $action != self::DROP) ? $this->$property : null; |
Collaborator
There was a problem hiding this comment.
have all the conditions in a single parentheses
grigoryanmartin20
approved these changes
May 19, 2022
Vahram1995
approved these changes
May 19, 2022
Vahram1995
approved these changes
May 19, 2022
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.