db = $db; } /** * @param IOutput $output * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param array $options */ public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void { } /** * @param IOutput $output * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param array $options * @return null|ISchemaWrapper */ public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { /** @var ISchemaWrapper $schema */ $schema = $schemaClosure(); $tableprefix = "gestion_"; /** DEFUNT - Ajout du champ lieu_deces **/ if ($schema->hasTable($tableprefix.'defunt')) { $table = $schema->getTable($tableprefix.'defunt'); if (!$table->hasColumn('lieu_deces')) { $table->addColumn('lieu_deces', 'string', [ 'length' => 255, 'notnull' => false, 'default' => null ]); } } return $schema; } /** * @param IOutput $output * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param array $options */ public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void { } }