mirror of
https://github.com/flarum/framework.git
synced 2024-12-05 09:03:36 +08:00
Fix migrate command and generated migration namespace
This commit is contained in:
parent
1dd847bd36
commit
0952651cf3
|
@ -30,12 +30,12 @@ class Server extends AbstractServer
|
||||||
{
|
{
|
||||||
$app = $this->getApp();
|
$app = $this->getApp();
|
||||||
|
|
||||||
$console = new Application('Flarum', $app::VERSION);
|
$console = new Application('Flarum', $app->version());
|
||||||
|
|
||||||
$app->register('Flarum\Install\InstallServiceProvider');
|
$app->register('Flarum\Install\InstallServiceProvider');
|
||||||
|
|
||||||
$console->add($app->make('Flarum\Install\Console\InstallCommand'));
|
$console->add($app->make('Flarum\Install\Console\InstallCommand'));
|
||||||
$console->add($app->make('Flarum\Console\Command\UpgradeCommand'));
|
$console->add($app->make('Flarum\Update\Console\MigrateCommand'));
|
||||||
$console->add($app->make('Flarum\Console\Command\GenerateExtensionCommand'));
|
$console->add($app->make('Flarum\Console\Command\GenerateExtensionCommand'));
|
||||||
$console->add($app->make('Flarum\Console\Command\GenerateMigrationCommand'));
|
$console->add($app->make('Flarum\Console\Command\GenerateMigrationCommand'));
|
||||||
|
|
||||||
|
|
|
@ -92,8 +92,10 @@ class MigrationCreator
|
||||||
*/
|
*/
|
||||||
protected function populateStub($extension, $name, $stub, $table)
|
protected function populateStub($extension, $name, $stub, $table)
|
||||||
{
|
{
|
||||||
|
list($vendor, $package) = explode('-', $extension, 2);
|
||||||
|
|
||||||
$replacements = [
|
$replacements = [
|
||||||
'{{namespace}}' => Str::studly($extension) ?: 'Flarum\Core',
|
'{{namespace}}' => Str::studly($vendor).'\\'.Str::studly($package) ?: 'Flarum\Core',
|
||||||
'{{name}}' => Str::studly($name),
|
'{{name}}' => Str::studly($name),
|
||||||
'{{table}}' => $table
|
'{{table}}' => $table
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user