Command:
1 |
php artisan make:migration add_oi_preserved_order_table --table=orders |
Migration Class:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class AddOiPreservedOrderTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->renameColumn('from', 'to'); //Add column tag_id after password $table->string('tag_id')->after('password')->nullable(); $table->integer('sell_rate')->nullable()->after('rate')->change(); $table->decimal('oi_preserved', 10, 2)->nullable()->after('commissioned_price')->change(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { $table->dropColumn('oi_preserved'); }); } } |
This package is required to change columns
1 |
composer require doctrine/dbal |
Required PHP extension
- extension=fileinfo
- extension=pdo_mysql
Doc: