Skip to content

Commit

Permalink
Add DB migration template
Browse files Browse the repository at this point in the history
  • Loading branch information
ottaviano committed Jan 30, 2025
1 parent 955d778 commit 29e9d99
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 112 deletions.
4 changes: 0 additions & 4 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,10 @@
'native_function_invocation' => ['include' => ['@compiler_optimized']],
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'App/doctrine_migration_clean' => true,
'attribute_empty_parentheses' => true,
'ordered_attributes' => true,
])
->setRiskyAllowed(true)
->setFinder($finder)
->setCacheFile(__DIR__.'/var/.php_cs/.php_cs.cache')
->registerCustomFixers([
new App\Fixer\DoctrineMigrationCleanFixer(),
])
;
1 change: 1 addition & 0 deletions config/packages/doctrine_migrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ doctrine_migrations:
table_storage:
table_name: 'migrations'
organize_migrations: 'BY_YEAR'
custom_template: '%kernel.project_dir%/migrations/migration.tpl'
19 changes: 19 additions & 0 deletions migrations/migration.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace <namespace>;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class <className> extends AbstractMigration
{
public function up(Schema $schema): void
{
<up>
}

public function down(Schema $schema): void
{
<down>
}
}
108 changes: 0 additions & 108 deletions src/Fixer/DoctrineMigrationCleanFixer.php

This file was deleted.

0 comments on commit 29e9d99

Please sign in to comment.