id(); $table->string('name'); $table->string('unit'); $table->string('description')->nullable(); $table->timestamps(); }); Schema::create('rates', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('currency_id'); $table->foreign('currency_id')->references('id')->on('currency'); $table->unsignedBigInteger('relative_id'); $table->foreign('relative_id')->references('id')->on('currency'); $table->float('value'); $table->timestamps(); }); DB::table('currency')->insert( array( 'name' => 'Bitcoin', 'unit' => 'BTC', 'description' => 'Created by Satoshi' ) ); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('coins'); Schema::dropIfExists('rates'); } }