kerrialn / indoctrinate
An automated package helps you align your database with Doctrine or simply fix database issues.
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/kerrialn/indoctrinate
Requires
- php: ^7.4
- ext-pdo: *
- nette/utils: ^3.2
- nikic/php-parser: ^4.19.4
- symfony/console: ^5.4
- symfony/filesystem: ^5.4
- symfony/finder: ^5.4
Requires (Dev)
- phpunit/phpunit: ^9.6
- rector/rector: ^2.1
- symplify/easy-coding-standard: ^12.5
README
An automated package helps you align your database with Doctrine or simply fix database issues.
Installation
composer require kerrialn/indoctrinate
Configuration
create config/indoctrinate.php
in the root directory of your project.
<?php return static function (DbFixerConfig $config): void { $config->connection( driver: 'mysql', host: '127.0.0.1', port: 3306, dbname: 'IM_A_DATABASE_NAME, user: 'happy_user', password: '12345678', ); $config->rules([ EnsureAutoIncrementPrimaryKeyRule::class => new EnsureAutoIncrementPrimaryKeyRuleConstraints( false, false, [], ['default_ci_sessions', '%session%', '%cache%', '%temp%', '%tmp%'], 500000, true, false ), ]); };
If you want to register indiviual rule constraints, you can do so like this:
$config->rules([ EnsureAutoIncrementPrimaryKeyRule::class => new EnsureAutoIncrementPrimaryKeyRuleConstraints( false, false, [], ['default_ci_sessions', '%session%', '%cache%', '%temp%', '%tmp%'], 500000, true, false ), ]);
Usage
php bin/indoctrinate fix
php bin/indoctrinate fix --dry
Options
--log=<log-dir>