Files
wh-api/migrations/2024_12_24_150857_create_column_config_table.php
ykxiao 0b2299c427
Some checks failed
Build Docker / build (push) Has been cancelled
协程版仓库后端项目
2025-07-08 14:59:47 +08:00

48 lines
1.9 KiB
PHP
Executable File

<?php
use App\Service\MigrateService;
use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('column_config', function (Blueprint $table) {
$table->unsignedInteger('id', true);
$table->integer('company_id')->unsigned()->default(0)->comment('公司ID');
$table->string('method', 50)->default('')->comment('场景');
$table->string('prop', 50)->default('')->comment('字段');
$table->string('label', 50)->default('')->comment('名称');
$table->boolean('sortable')->default(true)->comment('是否开启排序');
$table->integer('sort')->default(0)->comment('排序值');
$table->integer('width')->default(0)->comment('宽度');
$table->boolean('hide')->default(true)->comment('是否显示');
$table->boolean('fix')->default(true)->comment('是否固定');
$table->boolean('filter')->default(true)->comment('是否筛选');
$table->boolean('is_search')->default(true)->comment('是否搜索');
$table->string('search_type', 50)->default('')->comment('搜索类型');
$table->string('condition', 50)->default('')->comment('搜索条件');
MigrateService::migrateCreateInfo($table);
$table->comment('列配置');
$table->index(['company_id', 'deleted_at'], 'company_id_deleted_at_index');
$table->index(['creator_id', 'method'], 'creator_id_method_index');
$table->unique(['prop', 'method', 'creator_id'], 'prop_method_creator_id_index');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('column_config');
}
};