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

v0.1.6 2025-10-13 14:32 UTC

This package is auto-updated.

Last update: 2025-10-13 14:34:24 UTC


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>