mardi 29 mai 2018

numberic field in psql , what the relevant in laravel schema?

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');


    }
}



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2JhlRBW
via IFTTT

Aucun commentaire:

Enregistrer un commentaire