Skip to content

Commit

Permalink
bug #328 fix for doctrine:schema:update (Zales0123)
Browse files Browse the repository at this point in the history
This PR was merged into the 1.0 branch.

Discussion
----------

Currently, if you install a plug-in via migrations, everything is fine.

But if you try with doctrine:schema:update, there's always a query that is executed, but not detected if you re-issue command:

ALTER TABLE sylius_refund_refund CHANGE type type VARCHAR(256) NOT NULL;
It's caused by lack of the comment for column. Having the Type definition updated solves this problem.

Commits
-------

72e90d9 fix
9caed83 Force upgrading the schema in workflow
  • Loading branch information
GSadee authored Jul 27, 2021
2 parents 74c340b + 9caed83 commit 2762ce9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,13 @@ jobs:
name: Install JS dependencies
run: (cd tests/Application && yarn install)

- name: Check out database schema update
run: |
(cd tests/Application && bin/console doctrine:database:create)
(cd tests/Application && bin/console doctrine:schema:update --force)
(cd tests/Application && bin/console doctrine:schema:validate)
(cd tests/Application && bin/console doctrine:database:drop --force)
-
name: Prepare test application database
run: |
Expand Down
5 changes: 5 additions & 0 deletions src/Entity/Type/RefundEnumType.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,9 @@ protected function createType(string $value): RefundTypeInterface
{
return new RefundType($value);
}

public function requiresSQLCommentHint(AbstractPlatform $platform): bool
{
return true;
}
}

0 comments on commit 2762ce9

Please sign in to comment.