35 lines
995 B
PHP
Executable File
35 lines
995 B
PHP
Executable File
<?php
|
|
|
|
use App\Service\MigrateService;
|
|
use Hyperf\Database\Schema\Schema;
|
|
use Hyperf\Database\Schema\Blueprint;
|
|
use Hyperf\Database\Migrations\Migration;
|
|
|
|
class CreateCompanyModulesTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*/
|
|
public function up(): void
|
|
{
|
|
Schema::create('company_modules', function (Blueprint $table) {
|
|
$table->unsignedInteger('id', true);
|
|
$table->integer('company_id')->default(0)->unsigned()->comment('公司ID');
|
|
$table->json('module_code')->comment('公司功能模块CODE列表');
|
|
$table->json('module_data_permissions')->comment('数据权限');
|
|
MigrateService::migrateCreateInfo($table);
|
|
$table->comment('公司功能模块管理表');
|
|
|
|
$table->index(['company_id'], 'idx_company_id');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('company_modules');
|
|
}
|
|
}
|