Add Models/ServerTransfer.php
This commit is contained in:
parent
5007ce0b1c
commit
86b7b6ecc3
2 changed files with 122 additions and 0 deletions
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
class AddTableServerTransfers extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::dropIfExists('server_transfers');
|
||||
|
||||
Schema::create('server_transfers', function (Blueprint $table) {
|
||||
$table->increments('id');
|
||||
$table->integer('server_id')->unsigned();
|
||||
$table->integer('old_node')->unsigned();
|
||||
$table->integer('new_node')->unsigned();
|
||||
$table->integer('old_allocation')->unsigned();
|
||||
$table->integer('new_allocation')->unsigned();
|
||||
$table->string('old_additional_allocations')->nullable();
|
||||
$table->string('new_additional_allocations')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::table('server_transfers', function (Blueprint $table) {
|
||||
$table->foreign('server_id')->references('id')->on('servers');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('server_transfers');
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue