Files
exchange-2.0/database/migrations/2014_10_11_100011_create_currencies_table.php
T
2020-10-24 10:31:52 +08:00

38 lines
945 B
PHP

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCurrenciesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('currencies', function (Blueprint $table) {
$table->id();
$table->bigInteger('country_id')->unsigned()->nullable();
$table->foreign('country_id')->references('id')->on('countries')->onDelete('cascade');
$table->string('name')->nullable();
$table->string('short_code')->nullable();
$table->string('symbol')->nullable();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('currencies');
}
}