该插件主要实现了SQL转换为Laravel数据库迁移类,加快开发速度。
授权:需要授权
作者:mycms
版本:v1.0.0
标识:UrlFormat
转换示例
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateMyArticleTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('my_article', function (Blueprint $table) {
$table->bigInteger("id",true,true);
$table->string("title",255);
$table->integer("category_id",false,false)->default(0);
$table->string("description",255)->default(NULL)->nullable();
$table->string("img",255)->default(NULL)->nullable();
$table->string("author",255)->default(NULL)->nullable();
$table->text("content");
$table->timestamp("created_at")->default(NULL)->nullable();
$table->timestamp("updated_at")->default(NULL)->nullable();
$table->engine = "InnoDB";
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('my_article');
}
}