Skip to content

Commit

Permalink
Merge pull request #1912 from tomudding/chore/doctrine-migrations
Browse files Browse the repository at this point in the history
chore: add Doctrine migrations
  • Loading branch information
tomudding authored Oct 20, 2024
2 parents 6bacc4b + a9ee7a0 commit ee2a044
Show file tree
Hide file tree
Showing 7 changed files with 695 additions and 143 deletions.
2 changes: 2 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 18 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ help:
@echo "Makefile commands:"
@echo "runprod"
@echo "rundev"
@echo "migrations-list - lists all migrations"
@echo "migrations-diff - creates a new migration"
@echo "migrations-execute VERSION=<version> - executes a specific migration"
@echo "updatecomposer"
@echo "updatepackage"
@echo "updatecss"
Expand Down Expand Up @@ -37,8 +40,20 @@ rundev: builddev
@make replenish
@docker compose exec web rm -rf data/cache/module-config-cache.application.config.cache.php

updatedb: rundev
@docker compose exec -T web ./orm orm:schema-tool:update --force --no-interaction
migration-list: replenish
@docker compose exec -T web ./orm migrations:list

migration-diff: replenish
@docker compose exec -T web ./orm migrations:diff
@docker cp "$(shell docker compose ps -q web)":/code/module/Application/migrations ./module/Application/migrations

migration-up: replenish migration-list
@read -p "Enter the migration version to execute (e.g., Application\\Migrations\\Version20241020212355 -- note escaping the backslashes is required): " version; \
docker compose exec -it web ./orm migrations:execute --up $$version

migration-down: replenish migration-list
@read -p "Enter the migration version to down (e.g., Application\\Migrations\\Version20241020212355 -- note escaping the backslashes is required): " version; \
docker compose exec -it web ./orm migrations:execute --down $$version

stop:
@docker compose down
Expand All @@ -50,7 +65,7 @@ runcoverage: loadenv
@vendor/phpunit/phpunit/phpunit --bootstrap ./bootstrap.php --configuration ./phpunit.xml --coverage-html ./coverage

runworkflows:
@act -P ubuntu-latest=shivammathur/node:latest
@act -P ubuntu-latest=shivammathur/node:latest

getvendordir:
@rm -Rf ./vendor
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
"setasign/fpdi": "2.3.6",
"tecnickcom/tcpdf": "6.5.0",
"jfcherng/php-diff": "^6.16.2",
"league/commonmark": "^2.4.2"
"league/commonmark": "^2.4.2",
"doctrine/migrations": "^3.8"
},
"require-dev": {
"ext-pdo_sqlite": "*",
Expand Down
Loading

0 comments on commit ee2a044

Please sign in to comment.