| Total Complexity | 2 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class CreateCustomerSystemsTable extends Migration |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Run the migrations. |
||
| 11 | * |
||
| 12 | * @return void |
||
| 13 | */ |
||
| 14 | public function up() |
||
| 15 | { |
||
| 16 | Schema::create('customer_systems', function(Blueprint $table) { |
||
| 17 | $table->increments('cust_sys_id'); |
||
| 18 | $table->integer('cust_id')->unsigned(); |
||
| 19 | $table->integer('sys_id')->unsigned(); |
||
| 20 | $table->boolean('shared')->default(0); |
||
| 21 | $table->softDeletes(); |
||
| 22 | $table->timestamps(); |
||
| 23 | $table->foreign('cust_id')->references('cust_id')->on('customers')->onUpdate('cascade')->onDelete('cascade'); |
||
| 24 | $table->foreign('sys_id')->references('sys_id')->on('system_types')->onUpdate('cascade'); |
||
| 25 | }); |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Reverse the migrations. |
||
| 30 | * |
||
| 31 | * @return void |
||
| 32 | */ |
||
| 33 | public function down() |
||
| 34 | { |
||
| 35 | Schema::dropIfExists('customer_systems'); |
||
| 36 | } |
||
| 38 |