1
0
mirror of https://github.com/flarum/core.git synced 2025-07-19 07:41:22 +02:00

Update generate:migration command to deal with new migration structure

This commit is contained in:
Franz Liedke
2016-02-24 23:20:33 +09:00
parent 14ecd325e1
commit 0411cc5137
5 changed files with 55 additions and 97 deletions

View File

@@ -1,18 +1,13 @@
<?php
namespace {{namespace}}\Migration;
use Illuminate\Database\Schema\Builder;
use Flarum\Database\AbstractMigration;
return [
'up' => function (Builder $schema) {
//
},
class {{name}} extends AbstractMigration
{
public function up()
{
'down' => function (Builder $schema) {
//
}
public function down()
{
//
}
}
];

View File

@@ -1,21 +1,16 @@
<?php
namespace {{namespace}}\Migration;
use Flarum\Database\AbstractMigration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
class {{name}} extends AbstractMigration
{
public function up()
{
$this->schema->create('{{table}}', function (Blueprint $table) {
return [
'up' => function (Builder $schema) {
$schema->create('{{table}}', function (Blueprint $table) {
$table->increments('id');
});
}
},
public function down()
{
$this->schema->drop('{{table}}');
'down' => function (Builder $schema) {
$schema->drop('{{table}}');
}
}
];

View File

@@ -1,23 +1,18 @@
<?php
namespace {{namespace}}\Migration;
use Flarum\Database\AbstractMigration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
class {{name}} extends AbstractMigration
{
public function up()
{
$this->schema->table('{{table}}', function (Blueprint $table) {
return [
'up' => function (Builder $schema) {
$schema->table('{{table}}', function (Blueprint $table) {
//
});
},
'down' => function (Builder $schema) {
$schema->table('{{table}}', function (Blueprint $table) {
//
});
}
public function down()
{
$this->schema->table('{{table}}', function (Blueprint $table) {
//
});
}
}
];