davedevelopment / phpmig

Simple migrations system for php
Other
569 stars 92 forks source link

Allow to change migration basename format #151

Open Arcesilas opened 3 years ago

Arcesilas commented 3 years ago

By default, the migration file basename is:

$basename = date('YmdHis') . '_' . $migrationName . '.php';

Could it be possible to allow to change this by providing a callback? For example, something like:

$callback = $this->container['phpmig.basename_callback'] ?? null;
$basename = $callback ? $callback($migrationName) : date('YmdHis') . '_' . $migrationName . '.php'

This sould not introduce BC break.