Skip to content

Migration feature#65

Merged
armanist merged 26 commits into
quantum-php:masterfrom
armanist:master
May 19, 2022
Merged

Migration feature#65
armanist merged 26 commits into
quantum-php:masterfrom
armanist:master

Conversation

@armanist

Copy link
Copy Markdown
Collaborator

No description provided.

@armanist armanist added the help wanted Extra attention is needed label May 17, 2022
@armanist armanist requested review from a team, Vahram1995 and grigoryanmartin20 May 17, 2022 08:53

@andrey-smaelov andrey-smaelov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check comments and apply changes

class MigrationException extends \Exception
{

const WRONG_MIGRATION_DIRECTION = 'Migration direction can only be [up] or [down]';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing doc-block comments for constants

Comment thread src/Factory/TableFactory.php Outdated
*/
public function rename(string $oldName, string $newName): bool
{
$this->get($oldName)->setAction(Table::RENAME, ['newName' => $newName]);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The action can be passed to $this->get() as second argument

Comment thread src/Factory/TableFactory.php Outdated
*/
public function drop(string $name): bool
{
$this->get($name)->setAction(Table::DROP);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The action can be passed to $this->get() as second argument

Comment thread src/Migration/MigrationTemplate.php Outdated

use Quantum\Migration\QtMigration;
use Quantum\Factory\TableFactory;
use Quantum\Libraries\Database\Type;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Type class import path is not correct

@armanist armanist requested a review from andrey-smaelov May 18, 2022 11:49

try {
$migrated = $migrationManager->applyMigrations($direction, $step);
$this->info($migrated . ' migration' . ($migrated > 1 ? 's' : '') . ' ' . ($migrated > 1 ? 'were' : 'was') . ' applied');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be checked with one condition

*/
public function get(string $property, string $action = null)
{
return isset($this->$property) && ($action != self::RENAME && $action != self::DROP) ? $this->$property : null;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have all the conditions in a single parentheses

@armanist armanist requested a review from Vahram1995 May 19, 2022 09:56
@armanist armanist merged commit b7a7bba into quantum-php:master May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants