42 lines
886 B
PHP
42 lines
886 B
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
|
||
|
class CreateCurrencyTable extends Migration {
|
||
|
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
Schema::create('currency', function(Blueprint $table)
|
||
|
{
|
||
|
$table->integer('id',TRUE);
|
||
|
$table->integer('country_id')->nullable();
|
||
|
$table->string('name', 128)->nullable();
|
||
|
$table->boolean('active')->nullable();
|
||
|
$table->text('convert_array')->nullable();
|
||
|
$table->string('notes', 128)->nullable();
|
||
|
$table->string('symbol', 16)->nullable();
|
||
|
$table->string('three_digit', 3)->nullable()->unique();
|
||
|
|
||
|
$table->foreign('country_id')->references('id')->on('country')->onUpdate('NO ACTION')->onDelete('NO ACTION');
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
Schema::drop('currency');
|
||
|
}
|
||
|
|
||
|
}
|