Files
wh-api/migrations/2025_07_10_154954_create_company_modules_table.php
ykxiao 8a3ab17b25
Some checks failed
Build Docker / build (push) Has been cancelled
增加基础配置
2025-07-12 11:59:33 +08:00

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');
}
}