36 lines
669 B
PHP
36 lines
669 B
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
|
||
|
class AddForeignKeysToAbAdslSupplierPlanTable extends Migration {
|
||
|
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
Schema::table('ab_adsl_supplier_plan', function(Blueprint $table)
|
||
|
{
|
||
|
$table->foreign('supplier_id', 'fk_asp_as')->references('id')->on('ab_adsl_supplier')->onUpdate('NO ACTION')->onDelete('NO ACTION');
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
Schema::table('ab_adsl_supplier_plan', function(Blueprint $table)
|
||
|
{
|
||
|
$table->dropForeign('fk_asp_as');
|
||
|
});
|
||
|
}
|
||
|
|
||
|
}
|