vd/database/migrations/2019_03_08_110806_create_company_relations.php
2019-03-08 15:47:28 +08:00

43 lines
1.3 KiB
PHP

<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCompanyRelations extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (!Schema::hasTable('real_virtual_relations')) {
Schema::create('real_virtual_relations', function (Blueprint $table) {
$table->integer('real_company_id')->unsigned()->default(0)->comment('RD企业ID');
$table->integer('real_package_id')->unsigned()->default(0)->comment('RD套餐ID');
$table->integer('virtual_company_id')->unsigned()->default(0)->comment('VD企业ID');
$table->integer('virtual_package_id')->unsigned()->default(0)->comment('VD套餐ID');
$table->integer('times')->unsigned()->default(0)->comment('关联次数');
$table->timestamp('updated_at')->comment('更新时间');
$table->primary(['real_company_id', 'real_package_id', 'virtual_company_id', 'virtual_package_id']);
$table->comment('RD VD关系关联');
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('real_virtual_relations');
}
}