kosa3/migration-stub-extention
Composer 安装命令:
composer require kosa3/migration-stub-extention
包简介
README 文档
README
Install
Require this package with composer using the following command:
composer require --dev kosa3/migration-stub-extention:dev-master
After updating composer, add the migration directory to the resources stubs blank.stub create.stub update.stub
You can customize the stub file freely.
public function up() { Schema::create('DummyTable', function (Blueprint $table) { $table->bigIncrements('id'); $table->timestamp('created_at')->nullable(); $table->string('create_type', 32)->nullable()->default(null); $table->integer('create_id')->nullable()->default(null); $table->timestamp('updated_at')->nullable(); $table->string('update_type', 32)->nullable()->default(null); $table->integer('update_id')->nullable()->default(null); }); }
After edited, make migration file by artisan command.
php artisan make:migration CreateUser --create users
class CreateUser extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('users', function (Blueprint $table) { $table->bigIncrements('id'); $table->timestamp('created_at')->nullable(); $table->string('create_type', 32)->nullable()->default(null); $table->integer('create_id')->nullable()->default(null); $table->timestamp('updated_at')->nullable(); $table->string('update_type', 32)->nullable()->default(null); $table->integer('update_id')->nullable()->default(null); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('users'); } }
License
The package is open-source software licensed under the MIT license.
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-04-07