I want to change $table->unsignedInteger('conversion)
to using numberic
value store in psql
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateMoneyTables extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('currencies', function (Blueprint $table) {
$table->increments('id'); //1
$table->string('name', 50);//USD - US DollarUSD
$table->string('country', 20);//US
$table->timestamps();
});
Schema::create('conversions', function (Blueprint $table) {
$table->increments('id');//1
$table->unsignedInteger('currency_id');//1. USD
$table->unsignedInteger('conversion');//=4200
$table->unsignedInteger('to_id');//2. KHR
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('currencies');
Schema::dropIfExists('conversions');
}
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire