sunpengfei
2025-08-04 d3f1887ba4a8b4ad822406a7a4fc97dbfea91850
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
using System;
using Microsoft.EntityFrameworkCore.Migrations;
 
#nullable disable
 
namespace FlexJobApi.Database.Migrations.Migrations
{
    /// <inheritdoc />
    public partial class UpdateMenu : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "IsHidden",
                table: "Menu");
 
            migrationBuilder.AlterTable(
                name: "RoleResource",
                comment: "角色资源");
 
            migrationBuilder.AlterTable(
                name: "Resource",
                comment: "资源");
 
            migrationBuilder.AlterColumn<Guid>(
                name: "RoleId",
                table: "RoleResource",
                type: "uniqueidentifier",
                nullable: false,
                comment: "角色Id",
                oldClrType: typeof(Guid),
                oldType: "uniqueidentifier");
 
            migrationBuilder.AlterColumn<Guid>(
                name: "MenuId",
                table: "RoleResource",
                type: "uniqueidentifier",
                nullable: false,
                comment: "菜单Id",
                oldClrType: typeof(Guid),
                oldType: "uniqueidentifier");
 
            migrationBuilder.AlterColumn<int>(
                name: "DataPower",
                table: "RoleResource",
                type: "int",
                nullable: true,
                comment: "数据权限",
                oldClrType: typeof(int),
                oldType: "int",
                oldNullable: true);
 
            migrationBuilder.AlterColumn<string>(
                name: "Service",
                table: "Resource",
                type: "nvarchar(max)",
                nullable: false,
                comment: "微服务",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)");
 
            migrationBuilder.AlterColumn<string>(
                name: "Route",
                table: "Resource",
                type: "nvarchar(max)",
                nullable: false,
                comment: "路由",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)");
 
            migrationBuilder.AlterColumn<string>(
                name: "ResponseTypeName",
                table: "Resource",
                type: "nvarchar(max)",
                nullable: false,
                comment: "响应类型名称",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)");
 
            migrationBuilder.AlterColumn<string>(
                name: "RequestTypeName",
                table: "Resource",
                type: "nvarchar(max)",
                nullable: false,
                comment: "请求类型名称",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)");
 
            migrationBuilder.AlterColumn<string>(
                name: "Name",
                table: "Resource",
                type: "nvarchar(max)",
                nullable: false,
                comment: "名称",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)");
 
            migrationBuilder.AlterColumn<int>(
                name: "Method",
                table: "Resource",
                type: "int",
                nullable: false,
                comment: "请求方式",
                oldClrType: typeof(int),
                oldType: "int");
 
            migrationBuilder.AlterColumn<bool>(
                name: "IsExpired",
                table: "Resource",
                type: "bit",
                nullable: false,
                comment: "是否已过期",
                oldClrType: typeof(bool),
                oldType: "bit");
 
            migrationBuilder.AlterColumn<string>(
                name: "Code",
                table: "Resource",
                type: "nvarchar(max)",
                nullable: false,
                comment: "编号",
                oldClrType: typeof(string),
                oldType: "nvarchar(max)");
 
            migrationBuilder.AddColumn<int>(
                name: "ClientType",
                table: "Menu",
                type: "int",
                nullable: false,
                defaultValue: 0,
                comment: "客户端类型");
 
            migrationBuilder.AddColumn<int>(
                name: "UserType",
                table: "Menu",
                type: "int",
                nullable: false,
                defaultValue: 0,
                comment: "用户类型");
        }
 
        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "ClientType",
                table: "Menu");
 
            migrationBuilder.DropColumn(
                name: "UserType",
                table: "Menu");
 
            migrationBuilder.AlterTable(
                name: "RoleResource",
                oldComment: "角色资源");
 
            migrationBuilder.AlterTable(
                name: "Resource",
                oldComment: "资源");
 
            migrationBuilder.AlterColumn<Guid>(
                name: "RoleId",
                table: "RoleResource",
                type: "uniqueidentifier",
                nullable: false,
                oldClrType: typeof(Guid),
                oldType: "uniqueidentifier",
                oldComment: "角色Id");
 
            migrationBuilder.AlterColumn<Guid>(
                name: "MenuId",
                table: "RoleResource",
                type: "uniqueidentifier",
                nullable: false,
                oldClrType: typeof(Guid),
                oldType: "uniqueidentifier",
                oldComment: "菜单Id");
 
            migrationBuilder.AlterColumn<int>(
                name: "DataPower",
                table: "RoleResource",
                type: "int",
                nullable: true,
                oldClrType: typeof(int),
                oldType: "int",
                oldNullable: true,
                oldComment: "数据权限");
 
            migrationBuilder.AlterColumn<string>(
                name: "Service",
                table: "Resource",
                type: "nvarchar(max)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldComment: "微服务");
 
            migrationBuilder.AlterColumn<string>(
                name: "Route",
                table: "Resource",
                type: "nvarchar(max)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldComment: "路由");
 
            migrationBuilder.AlterColumn<string>(
                name: "ResponseTypeName",
                table: "Resource",
                type: "nvarchar(max)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldComment: "响应类型名称");
 
            migrationBuilder.AlterColumn<string>(
                name: "RequestTypeName",
                table: "Resource",
                type: "nvarchar(max)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldComment: "请求类型名称");
 
            migrationBuilder.AlterColumn<string>(
                name: "Name",
                table: "Resource",
                type: "nvarchar(max)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldComment: "名称");
 
            migrationBuilder.AlterColumn<int>(
                name: "Method",
                table: "Resource",
                type: "int",
                nullable: false,
                oldClrType: typeof(int),
                oldType: "int",
                oldComment: "请求方式");
 
            migrationBuilder.AlterColumn<bool>(
                name: "IsExpired",
                table: "Resource",
                type: "bit",
                nullable: false,
                oldClrType: typeof(bool),
                oldType: "bit",
                oldComment: "是否已过期");
 
            migrationBuilder.AlterColumn<string>(
                name: "Code",
                table: "Resource",
                type: "nvarchar(max)",
                nullable: false,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldComment: "编号");
 
            migrationBuilder.AddColumn<bool>(
                name: "IsHidden",
                table: "Menu",
                type: "bit",
                nullable: false,
                defaultValue: false,
                comment: "是否隐藏");
        }
    }
}