3 changed files with 86 additions and 3 deletions
-
16app/Entities/Agencies/Agency.php
-
37database/migrations/2017_11_02_175711_create_agency_workers_table.php
-
36tests/Unit/Models/AgencyTest.php
@ -0,0 +1,37 @@ |
|||||
|
<?php |
||||
|
|
||||
|
use Illuminate\Database\Migrations\Migration; |
||||
|
use Illuminate\Database\Schema\Blueprint; |
||||
|
use Illuminate\Support\Facades\Schema; |
||||
|
|
||||
|
class CreateAgencyWorkersTable extends Migration |
||||
|
{ |
||||
|
/** |
||||
|
* Run the migrations. |
||||
|
* |
||||
|
* @return void |
||||
|
*/ |
||||
|
public function up() |
||||
|
{ |
||||
|
Schema::create('agency_workers', function (Blueprint $table) { |
||||
|
$table->increments('id'); |
||||
|
$table->unsignedInteger('agency_id'); |
||||
|
$table->unsignedInteger('worker_id'); |
||||
|
$table->timestamps(); |
||||
|
|
||||
|
$table->unique(['agency_id', 'worker_id'], 'agency_worker_unique'); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Reverse the migrations. |
||||
|
* |
||||
|
* @return void |
||||
|
*/ |
||||
|
public function down() |
||||
|
{ |
||||
|
Schema::table('agency_workers', function (Blueprint $table) { |
||||
|
//
|
||||
|
}); |
||||
|
} |
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue