Skip to content

Commit b6d58a6

Browse files
committed
表迁移增加字段
1 parent ab1b24c commit b6d58a6

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

app/Model/Auth/Permission.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ private static function checkPermissionFilter(array $item) : array
8484
}
8585
return array_values($item);
8686
}
87+
return [];
8788
}
8889

8990
/**
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
use Hyperf\Database\Schema\Schema;
4+
use Hyperf\Database\Schema\Blueprint;
5+
use Hyperf\Database\Migrations\Migration;
6+
7+
class AddFieldTable extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
//好友聊天表增加文件后缀
15+
Schema::table('ct_friend_chat_history', function (Blueprint $table) {
16+
$table->string('file_ext', 255)->default('')->comment('文件后缀')->after('file_name');
17+
});
18+
//好友组增加字段
19+
Schema::table('ct_friend_group', function (Blueprint $table) {
20+
$table->integer('sort')->default(99)->comment('分组顺序 按顺序从小到大')->after('friend_group_name');
21+
});
22+
//好友关系表增加字段
23+
Schema::table('ct_friend_relation', function (Blueprint $table) {
24+
$table->string('friend_remark', 255)->default('')->comment('好友备注')->after('friend_id');
25+
$table->integer('friend_group')->default(0)->comment('好友分组')->after('friend_remark');
26+
$table->tinyInteger('is_up')->default(0)->comment('是否置顶1:是 0:否')->after('friend_group');
27+
$table->tinyInteger('is_not_disturb')->default(0)->comment('是否消息免打扰')->after('is_up');
28+
});
29+
//好友关系表增加字段
30+
Schema::table('ct_group_relation', function (Blueprint $table) {
31+
$table->tinyInteger('is_up')->default(0)->comment('是否置顶1:是 0:否')->after('group_id');
32+
$table->tinyInteger('is_not_disturb')->default(0)->comment('是否消息免打扰')->after('is_up');
33+
});
34+
}
35+
36+
/**
37+
* Reverse the migrations.
38+
*/
39+
public function down(): void
40+
{
41+
42+
}
43+
}

0 commit comments

Comments
 (0)