osb/database/migrations/2018_05_14_122513_currency_add_rounding.php
2018-05-20 22:53:14 +10:00

36 lines
723 B
PHP

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use App\Models\Currency;
class CurrencyAddRounding extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('ab_currency', function (Blueprint $table) {
$table->smallInteger('rounding');
});
Currency::query()->update(['rounding'=>2]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('ab_currency', function (Blueprint $table) {
$table->dropColumn('rounding');
});
}
}