mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-10 18:02:55 +00:00
fix:修复子任务可见性字段为null的数据
This commit is contained in:
parent
e2a0b7a033
commit
4912f97461
@ -1,7 +1,6 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class repairProjectTasksIsAllVisible extends Migration
|
||||
@ -14,19 +13,19 @@ class repairProjectTasksIsAllVisible extends Migration
|
||||
public function up()
|
||||
{
|
||||
// 修复子任务可见性字段为null的数据
|
||||
if (!Schema::hasTable('project_tasks')) {
|
||||
if (Schema::hasTable('project_tasks')) {
|
||||
$prefix = DB::getConfig('prefix');
|
||||
DB::select(DB::raw(`
|
||||
DB::update("
|
||||
UPDATE {$prefix}project_tasks
|
||||
SET is_all_visible = 1
|
||||
WHERE is_all_visible is null AND parent_id = 0
|
||||
`));
|
||||
DB::select(DB::raw(`
|
||||
WHERE is_all_visible is null AND parent_id = 0;
|
||||
");
|
||||
DB::update("
|
||||
UPDATE {$prefix}project_tasks t1
|
||||
JOIN {$prefix}project_tasks t2 ON t1.parent_id = t2.id
|
||||
SET t1.is_all_visible = t2.is_all_visible
|
||||
WHERE t1.is_all_visible is null AND t1.parent_id > 0
|
||||
`));
|
||||
WHERE t1.is_all_visible is null AND t1.parent_id > 0;
|
||||
");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user