Skip to content

Commit ef537fe

Browse files
committed
Integrate migrations run into build and tests
1 parent a637cb7 commit ef537fe

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ box-push-prd:
7272
cs-fix:
7373
ENV='tst' ./bin/run php vendor/bin/php-cs-fixer fix --verbose
7474

75+
db-migrate:
76+
ENV='dev' ./bin/run make db-migrate-guest
77+
78+
db-migrate-guest:
79+
php bin/console doctrine:migrations:migrate --no-interaction
80+
7581
db-setup:
7682
ENV='dev' ./bin/run make db-setup-guest
7783

@@ -80,6 +86,7 @@ db-setup-guest:
8086
php bin/console doctrine:database:drop -n --force
8187
php bin/console doctrine:database:create -n
8288
php bin/console doctrine:schema:create -n
89+
$(MAKE) db-migrate-guest
8390
php bin/console doctrine:fixtures:load -n
8491

8592
dep-clearcache-guest:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@
6464
},
6565
"autoload": {
6666
"psr-4": {
67-
"Acme\\App\\Build\\": "build/",
6867
"Acme\\App\\": "src/",
6968
"Acme\\PhpExtension\\": "lib/php-extension/src/"
7069
}
7170
},
7271
"autoload-dev": {
7372
"psr-4": {
73+
"Acme\\App\\Build\\": "build/",
7474
"Acme\\App\\Test\\": "tests/",
7575
"Acme\\PhpExtension\\Test\\": "lib/php-extension/tests/"
7676
}

composer.lock

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
doctrine_migrations:
2-
dir_name: '%kernel.project_dir%/build/Migration'
3-
# namespace is arbitrary but should be different from Acme\App\Migrations
4-
# as migrations classes should NOT be autoloaded
5-
namespace: DoctrineMigrations
2+
dir_name: '%kernel.project_dir%/build/Migration/Version'
3+
# namespace is arbitrary but should NOT be autoloaded in production
4+
namespace: Acme\App\Build\Migration\Version

0 commit comments

Comments
 (0)