1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 16:36:47 +02:00

Add migration generator

This commit is contained in:
Toby Zerner
2015-09-17 12:16:38 +09:30
parent d35d97ee6a
commit 5cc745f610
6 changed files with 336 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<?php
namespace Flarum\Migrations\{{extension}};
use Illuminate\Database\Schema\Blueprint;
use Flarum\Migrations\Migration;
class {{name}} extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

View File

@@ -0,0 +1,31 @@
<?php
namespace Flarum\Migrations\{{extension}};
use Illuminate\Database\Schema\Blueprint;
use Flarum\Migrations\Migration;
class {{name}} extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$this->schema->create('{{table}}', function (Blueprint $table) {
$table->increments('id');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$this->schema->drop('{{table}}');
}
}

View File

@@ -0,0 +1,33 @@
<?php
namespace Flarum\Migrations\{{extension}};
use Illuminate\Database\Schema\Blueprint;
use Flarum\Migrations\Migration;
class {{name}} extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
$this->schema->table('{{table}}', function (Blueprint $table) {
//
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
$this->schema->table('{{table}}', function (Blueprint $table) {
//
});
}
}