ADSL Traffic import

This commit is contained in:
Deon George
2020-05-28 15:08:13 +10:00
parent 86861a6daf
commit 7d41fb857a
9 changed files with 341 additions and 3 deletions

View File

@@ -0,0 +1,41 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class EnhanceAdslTraffic extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('ab_service__adsl_traffic', function (Blueprint $table) {
$table->bigInteger('ab_service_adsl_id')->nullable();
$table->foreign('ab_service_adsl_id')->references('id')->on('ab_service__adsl');
$table->unique(['ab_service_adsl_id','date','time']);
});
DB::statement('ALTER TABLE ab_service__adsl_traffic CHANGE COLUMN service service varchar(128) DEFAULT NULL');
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
DB::statement('ALTER TABLE ab_service__adsl_traffic CHANGE COLUMN service service varchar(128) NOT NULL');
Schema::table('ab_service__adsl_traffic', function (Blueprint $table) {
$table->dropForeign(['ab_service_adsl_id']);
$table->dropUnique(['ab_service_adsl_id','date','time']);
$table->dropColumn('ab_service_adsl_id');
});
}
}