This commit is contained in:
34
migrations/2025_07_10_154954_create_company_modules_table.php
Executable file
34
migrations/2025_07_10_154954_create_company_modules_table.php
Executable file
@ -0,0 +1,34 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user