abp

Форк
0
1131 строка · 61.2 Кб
1
using System;
2
using Microsoft.EntityFrameworkCore.Migrations;
3

4
#nullable disable
5

6
namespace MyCompanyName.MyProjectName.Mvc.Migrations
7
{
8
    /// <inheritdoc />
9
    public partial class Initial : Migration
10
    {
11
        /// <inheritdoc />
12
        protected override void Up(MigrationBuilder migrationBuilder)
13
        {
14
            migrationBuilder.CreateTable(
15
                name: "AbpAuditLogs",
16
                columns: table => new
17
                {
18
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
19
                    ApplicationName = table.Column<string>(type: "nvarchar(96)", maxLength: 96, nullable: true),
20
                    UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
21
                    UserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
22
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
23
                    TenantName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
24
                    ImpersonatorUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
25
                    ImpersonatorUserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
26
                    ImpersonatorTenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
27
                    ImpersonatorTenantName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
28
                    ExecutionTime = table.Column<DateTime>(type: "datetime2", nullable: false),
29
                    ExecutionDuration = table.Column<int>(type: "int", nullable: false),
30
                    ClientIpAddress = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
31
                    ClientName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
32
                    ClientId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
33
                    CorrelationId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
34
                    BrowserInfo = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
35
                    HttpMethod = table.Column<string>(type: "nvarchar(16)", maxLength: 16, nullable: true),
36
                    Url = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
37
                    Exceptions = table.Column<string>(type: "nvarchar(max)", nullable: true),
38
                    Comments = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
39
                    HttpStatusCode = table.Column<int>(type: "int", nullable: true),
40
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
41
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false)
42
                },
43
                constraints: table =>
44
                {
45
                    table.PrimaryKey("PK_AbpAuditLogs", x => x.Id);
46
                });
47

48
            migrationBuilder.CreateTable(
49
                name: "AbpClaimTypes",
50
                columns: table => new
51
                {
52
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
53
                    Name = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
54
                    Required = table.Column<bool>(type: "bit", nullable: false),
55
                    IsStatic = table.Column<bool>(type: "bit", nullable: false),
56
                    Regex = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
57
                    RegexDescription = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
58
                    Description = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
59
                    ValueType = table.Column<int>(type: "int", nullable: false),
60
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
61
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false)
62
                },
63
                constraints: table =>
64
                {
65
                    table.PrimaryKey("PK_AbpClaimTypes", x => x.Id);
66
                });
67

68
            migrationBuilder.CreateTable(
69
                name: "AbpFeatureGroups",
70
                columns: table => new
71
                {
72
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
73
                    Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
74
                    DisplayName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
75
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true)
76
                },
77
                constraints: table =>
78
                {
79
                    table.PrimaryKey("PK_AbpFeatureGroups", x => x.Id);
80
                });
81

82
            migrationBuilder.CreateTable(
83
                name: "AbpFeatures",
84
                columns: table => new
85
                {
86
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
87
                    GroupName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
88
                    Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
89
                    ParentName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
90
                    DisplayName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
91
                    Description = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
92
                    DefaultValue = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
93
                    IsVisibleToClients = table.Column<bool>(type: "bit", nullable: false),
94
                    IsAvailableToHost = table.Column<bool>(type: "bit", nullable: false),
95
                    AllowedProviders = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
96
                    ValueType = table.Column<string>(type: "nvarchar(2048)", maxLength: 2048, nullable: true),
97
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true)
98
                },
99
                constraints: table =>
100
                {
101
                    table.PrimaryKey("PK_AbpFeatures", x => x.Id);
102
                });
103

104
            migrationBuilder.CreateTable(
105
                name: "AbpFeatureValues",
106
                columns: table => new
107
                {
108
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
109
                    Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
110
                    Value = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
111
                    ProviderName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
112
                    ProviderKey = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true)
113
                },
114
                constraints: table =>
115
                {
116
                    table.PrimaryKey("PK_AbpFeatureValues", x => x.Id);
117
                });
118

119
            migrationBuilder.CreateTable(
120
                name: "AbpLinkUsers",
121
                columns: table => new
122
                {
123
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
124
                    SourceUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
125
                    SourceTenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
126
                    TargetUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
127
                    TargetTenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
128
                },
129
                constraints: table =>
130
                {
131
                    table.PrimaryKey("PK_AbpLinkUsers", x => x.Id);
132
                });
133

134
            migrationBuilder.CreateTable(
135
                name: "AbpOrganizationUnits",
136
                columns: table => new
137
                {
138
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
139
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
140
                    ParentId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
141
                    Code = table.Column<string>(type: "nvarchar(95)", maxLength: 95, nullable: false),
142
                    DisplayName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
143
                    EntityVersion = table.Column<int>(type: "int", nullable: false),
144
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
145
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
146
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
147
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
148
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
149
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
150
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
151
                    DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
152
                    DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
153
                },
154
                constraints: table =>
155
                {
156
                    table.PrimaryKey("PK_AbpOrganizationUnits", x => x.Id);
157
                    table.ForeignKey(
158
                        name: "FK_AbpOrganizationUnits_AbpOrganizationUnits_ParentId",
159
                        column: x => x.ParentId,
160
                        principalTable: "AbpOrganizationUnits",
161
                        principalColumn: "Id");
162
                });
163

164
            migrationBuilder.CreateTable(
165
                name: "AbpPermissionGrants",
166
                columns: table => new
167
                {
168
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
169
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
170
                    Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
171
                    ProviderName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
172
                    ProviderKey = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false)
173
                },
174
                constraints: table =>
175
                {
176
                    table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id);
177
                });
178

179
            migrationBuilder.CreateTable(
180
                name: "AbpPermissionGroups",
181
                columns: table => new
182
                {
183
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
184
                    Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
185
                    DisplayName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
186
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true)
187
                },
188
                constraints: table =>
189
                {
190
                    table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id);
191
                });
192

193
            migrationBuilder.CreateTable(
194
                name: "AbpPermissions",
195
                columns: table => new
196
                {
197
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
198
                    GroupName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
199
                    Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
200
                    ParentName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
201
                    DisplayName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
202
                    IsEnabled = table.Column<bool>(type: "bit", nullable: false),
203
                    MultiTenancySide = table.Column<byte>(type: "tinyint", nullable: false),
204
                    Providers = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
205
                    StateCheckers = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
206
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true)
207
                },
208
                constraints: table =>
209
                {
210
                    table.PrimaryKey("PK_AbpPermissions", x => x.Id);
211
                });
212

213
            migrationBuilder.CreateTable(
214
                name: "AbpRoles",
215
                columns: table => new
216
                {
217
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
218
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
219
                    Name = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
220
                    NormalizedName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
221
                    IsDefault = table.Column<bool>(type: "bit", nullable: false),
222
                    IsStatic = table.Column<bool>(type: "bit", nullable: false),
223
                    IsPublic = table.Column<bool>(type: "bit", nullable: false),
224
                    EntityVersion = table.Column<int>(type: "int", nullable: false),
225
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
226
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false)
227
                },
228
                constraints: table =>
229
                {
230
                    table.PrimaryKey("PK_AbpRoles", x => x.Id);
231
                });
232

233
            migrationBuilder.CreateTable(
234
                name: "AbpSecurityLogs",
235
                columns: table => new
236
                {
237
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
238
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
239
                    ApplicationName = table.Column<string>(type: "nvarchar(96)", maxLength: 96, nullable: true),
240
                    Identity = table.Column<string>(type: "nvarchar(96)", maxLength: 96, nullable: true),
241
                    Action = table.Column<string>(type: "nvarchar(96)", maxLength: 96, nullable: true),
242
                    UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
243
                    UserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
244
                    TenantName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
245
                    ClientId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
246
                    CorrelationId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
247
                    ClientIpAddress = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
248
                    BrowserInfo = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
249
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
250
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
251
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false)
252
                },
253
                constraints: table =>
254
                {
255
                    table.PrimaryKey("PK_AbpSecurityLogs", x => x.Id);
256
                });
257

258
            migrationBuilder.CreateTable(
259
                name: "AbpSessions",
260
                columns: table => new
261
                {
262
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
263
                    SessionId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
264
                    Device = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
265
                    DeviceInfo = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
266
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
267
                    UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
268
                    ClientId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
269
                    IpAddresses = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
270
                    SignedIn = table.Column<DateTime>(type: "datetime2", nullable: false),
271
                    LastAccessed = table.Column<DateTime>(type: "datetime2", nullable: true)
272
                },
273
                constraints: table =>
274
                {
275
                    table.PrimaryKey("PK_AbpSessions", x => x.Id);
276
                });
277

278
            migrationBuilder.CreateTable(
279
                name: "AbpSettingDefinitions",
280
                columns: table => new
281
                {
282
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
283
                    Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
284
                    DisplayName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
285
                    Description = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
286
                    DefaultValue = table.Column<string>(type: "nvarchar(2048)", maxLength: 2048, nullable: true),
287
                    IsVisibleToClients = table.Column<bool>(type: "bit", nullable: false),
288
                    Providers = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: true),
289
                    IsInherited = table.Column<bool>(type: "bit", nullable: false),
290
                    IsEncrypted = table.Column<bool>(type: "bit", nullable: false),
291
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true)
292
                },
293
                constraints: table =>
294
                {
295
                    table.PrimaryKey("PK_AbpSettingDefinitions", x => x.Id);
296
                });
297

298
            migrationBuilder.CreateTable(
299
                name: "AbpSettings",
300
                columns: table => new
301
                {
302
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
303
                    Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
304
                    Value = table.Column<string>(type: "nvarchar(2048)", maxLength: 2048, nullable: false),
305
                    ProviderName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
306
                    ProviderKey = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true)
307
                },
308
                constraints: table =>
309
                {
310
                    table.PrimaryKey("PK_AbpSettings", x => x.Id);
311
                });
312

313
            migrationBuilder.CreateTable(
314
                name: "AbpTenants",
315
                columns: table => new
316
                {
317
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
318
                    Name = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
319
                    NormalizedName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
320
                    EntityVersion = table.Column<int>(type: "int", nullable: false),
321
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
322
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
323
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
324
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
325
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
326
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
327
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
328
                    DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
329
                    DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
330
                },
331
                constraints: table =>
332
                {
333
                    table.PrimaryKey("PK_AbpTenants", x => x.Id);
334
                });
335

336
            migrationBuilder.CreateTable(
337
                name: "AbpUserDelegations",
338
                columns: table => new
339
                {
340
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
341
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
342
                    SourceUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
343
                    TargetUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
344
                    StartTime = table.Column<DateTime>(type: "datetime2", nullable: false),
345
                    EndTime = table.Column<DateTime>(type: "datetime2", nullable: false)
346
                },
347
                constraints: table =>
348
                {
349
                    table.PrimaryKey("PK_AbpUserDelegations", x => x.Id);
350
                });
351

352
            migrationBuilder.CreateTable(
353
                name: "AbpUsers",
354
                columns: table => new
355
                {
356
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
357
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
358
                    UserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
359
                    NormalizedUserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
360
                    Name = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
361
                    Surname = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
362
                    Email = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
363
                    NormalizedEmail = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
364
                    EmailConfirmed = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
365
                    PasswordHash = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
366
                    SecurityStamp = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
367
                    IsExternal = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
368
                    PhoneNumber = table.Column<string>(type: "nvarchar(16)", maxLength: 16, nullable: true),
369
                    PhoneNumberConfirmed = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
370
                    IsActive = table.Column<bool>(type: "bit", nullable: false),
371
                    TwoFactorEnabled = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
372
                    LockoutEnd = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
373
                    LockoutEnabled = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
374
                    AccessFailedCount = table.Column<int>(type: "int", nullable: false, defaultValue: 0),
375
                    ShouldChangePasswordOnNextLogin = table.Column<bool>(type: "bit", nullable: false),
376
                    EntityVersion = table.Column<int>(type: "int", nullable: false),
377
                    LastPasswordChangeTime = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: true),
378
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
379
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
380
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
381
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
382
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
383
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
384
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
385
                    DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
386
                    DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
387
                },
388
                constraints: table =>
389
                {
390
                    table.PrimaryKey("PK_AbpUsers", x => x.Id);
391
                });
392

393
            migrationBuilder.CreateTable(
394
                name: "OpenIddictApplications",
395
                columns: table => new
396
                {
397
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
398
                    ApplicationType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
399
                    ClientId = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
400
                    ClientSecret = table.Column<string>(type: "nvarchar(max)", nullable: true),
401
                    ClientType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
402
                    ConsentType = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
403
                    DisplayName = table.Column<string>(type: "nvarchar(max)", nullable: true),
404
                    DisplayNames = table.Column<string>(type: "nvarchar(max)", nullable: true),
405
                    JsonWebKeySet = table.Column<string>(type: "nvarchar(max)", nullable: true),
406
                    Permissions = table.Column<string>(type: "nvarchar(max)", nullable: true),
407
                    PostLogoutRedirectUris = table.Column<string>(type: "nvarchar(max)", nullable: true),
408
                    Properties = table.Column<string>(type: "nvarchar(max)", nullable: true),
409
                    RedirectUris = table.Column<string>(type: "nvarchar(max)", nullable: true),
410
                    Requirements = table.Column<string>(type: "nvarchar(max)", nullable: true),
411
                    Settings = table.Column<string>(type: "nvarchar(max)", nullable: true),
412
                    ClientUri = table.Column<string>(type: "nvarchar(max)", nullable: true),
413
                    LogoUri = table.Column<string>(type: "nvarchar(max)", nullable: true),
414
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
415
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
416
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
417
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
418
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
419
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
420
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
421
                    DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
422
                    DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
423
                },
424
                constraints: table =>
425
                {
426
                    table.PrimaryKey("PK_OpenIddictApplications", x => x.Id);
427
                });
428

429
            migrationBuilder.CreateTable(
430
                name: "OpenIddictScopes",
431
                columns: table => new
432
                {
433
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
434
                    Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
435
                    Descriptions = table.Column<string>(type: "nvarchar(max)", nullable: true),
436
                    DisplayName = table.Column<string>(type: "nvarchar(max)", nullable: true),
437
                    DisplayNames = table.Column<string>(type: "nvarchar(max)", nullable: true),
438
                    Name = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: true),
439
                    Properties = table.Column<string>(type: "nvarchar(max)", nullable: true),
440
                    Resources = table.Column<string>(type: "nvarchar(max)", nullable: true),
441
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
442
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
443
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
444
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
445
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
446
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
447
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
448
                    DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
449
                    DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
450
                },
451
                constraints: table =>
452
                {
453
                    table.PrimaryKey("PK_OpenIddictScopes", x => x.Id);
454
                });
455

456
            migrationBuilder.CreateTable(
457
                name: "AbpAuditLogActions",
458
                columns: table => new
459
                {
460
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
461
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
462
                    AuditLogId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
463
                    ServiceName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
464
                    MethodName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
465
                    Parameters = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
466
                    ExecutionTime = table.Column<DateTime>(type: "datetime2", nullable: false),
467
                    ExecutionDuration = table.Column<int>(type: "int", nullable: false),
468
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true)
469
                },
470
                constraints: table =>
471
                {
472
                    table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id);
473
                    table.ForeignKey(
474
                        name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId",
475
                        column: x => x.AuditLogId,
476
                        principalTable: "AbpAuditLogs",
477
                        principalColumn: "Id",
478
                        onDelete: ReferentialAction.Cascade);
479
                });
480

481
            migrationBuilder.CreateTable(
482
                name: "AbpEntityChanges",
483
                columns: table => new
484
                {
485
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
486
                    AuditLogId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
487
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
488
                    ChangeTime = table.Column<DateTime>(type: "datetime2", nullable: false),
489
                    ChangeType = table.Column<byte>(type: "tinyint", nullable: false),
490
                    EntityTenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
491
                    EntityId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
492
                    EntityTypeFullName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
493
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true)
494
                },
495
                constraints: table =>
496
                {
497
                    table.PrimaryKey("PK_AbpEntityChanges", x => x.Id);
498
                    table.ForeignKey(
499
                        name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId",
500
                        column: x => x.AuditLogId,
501
                        principalTable: "AbpAuditLogs",
502
                        principalColumn: "Id",
503
                        onDelete: ReferentialAction.Cascade);
504
                });
505

506
            migrationBuilder.CreateTable(
507
                name: "AbpOrganizationUnitRoles",
508
                columns: table => new
509
                {
510
                    RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
511
                    OrganizationUnitId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
512
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
513
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
514
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
515
                },
516
                constraints: table =>
517
                {
518
                    table.PrimaryKey("PK_AbpOrganizationUnitRoles", x => new { x.OrganizationUnitId, x.RoleId });
519
                    table.ForeignKey(
520
                        name: "FK_AbpOrganizationUnitRoles_AbpOrganizationUnits_OrganizationUnitId",
521
                        column: x => x.OrganizationUnitId,
522
                        principalTable: "AbpOrganizationUnits",
523
                        principalColumn: "Id",
524
                        onDelete: ReferentialAction.Cascade);
525
                    table.ForeignKey(
526
                        name: "FK_AbpOrganizationUnitRoles_AbpRoles_RoleId",
527
                        column: x => x.RoleId,
528
                        principalTable: "AbpRoles",
529
                        principalColumn: "Id",
530
                        onDelete: ReferentialAction.Cascade);
531
                });
532

533
            migrationBuilder.CreateTable(
534
                name: "AbpRoleClaims",
535
                columns: table => new
536
                {
537
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
538
                    RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
539
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
540
                    ClaimType = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
541
                    ClaimValue = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: true)
542
                },
543
                constraints: table =>
544
                {
545
                    table.PrimaryKey("PK_AbpRoleClaims", x => x.Id);
546
                    table.ForeignKey(
547
                        name: "FK_AbpRoleClaims_AbpRoles_RoleId",
548
                        column: x => x.RoleId,
549
                        principalTable: "AbpRoles",
550
                        principalColumn: "Id",
551
                        onDelete: ReferentialAction.Cascade);
552
                });
553

554
            migrationBuilder.CreateTable(
555
                name: "AbpTenantConnectionStrings",
556
                columns: table => new
557
                {
558
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
559
                    Name = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
560
                    Value = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: false)
561
                },
562
                constraints: table =>
563
                {
564
                    table.PrimaryKey("PK_AbpTenantConnectionStrings", x => new { x.TenantId, x.Name });
565
                    table.ForeignKey(
566
                        name: "FK_AbpTenantConnectionStrings_AbpTenants_TenantId",
567
                        column: x => x.TenantId,
568
                        principalTable: "AbpTenants",
569
                        principalColumn: "Id",
570
                        onDelete: ReferentialAction.Cascade);
571
                });
572

573
            migrationBuilder.CreateTable(
574
                name: "AbpUserClaims",
575
                columns: table => new
576
                {
577
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
578
                    UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
579
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
580
                    ClaimType = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
581
                    ClaimValue = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: true)
582
                },
583
                constraints: table =>
584
                {
585
                    table.PrimaryKey("PK_AbpUserClaims", x => x.Id);
586
                    table.ForeignKey(
587
                        name: "FK_AbpUserClaims_AbpUsers_UserId",
588
                        column: x => x.UserId,
589
                        principalTable: "AbpUsers",
590
                        principalColumn: "Id",
591
                        onDelete: ReferentialAction.Cascade);
592
                });
593

594
            migrationBuilder.CreateTable(
595
                name: "AbpUserLogins",
596
                columns: table => new
597
                {
598
                    UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
599
                    LoginProvider = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
600
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
601
                    ProviderKey = table.Column<string>(type: "nvarchar(196)", maxLength: 196, nullable: false),
602
                    ProviderDisplayName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true)
603
                },
604
                constraints: table =>
605
                {
606
                    table.PrimaryKey("PK_AbpUserLogins", x => new { x.UserId, x.LoginProvider });
607
                    table.ForeignKey(
608
                        name: "FK_AbpUserLogins_AbpUsers_UserId",
609
                        column: x => x.UserId,
610
                        principalTable: "AbpUsers",
611
                        principalColumn: "Id",
612
                        onDelete: ReferentialAction.Cascade);
613
                });
614

615
            migrationBuilder.CreateTable(
616
                name: "AbpUserOrganizationUnits",
617
                columns: table => new
618
                {
619
                    UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
620
                    OrganizationUnitId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
621
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
622
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
623
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
624
                },
625
                constraints: table =>
626
                {
627
                    table.PrimaryKey("PK_AbpUserOrganizationUnits", x => new { x.OrganizationUnitId, x.UserId });
628
                    table.ForeignKey(
629
                        name: "FK_AbpUserOrganizationUnits_AbpOrganizationUnits_OrganizationUnitId",
630
                        column: x => x.OrganizationUnitId,
631
                        principalTable: "AbpOrganizationUnits",
632
                        principalColumn: "Id",
633
                        onDelete: ReferentialAction.Cascade);
634
                    table.ForeignKey(
635
                        name: "FK_AbpUserOrganizationUnits_AbpUsers_UserId",
636
                        column: x => x.UserId,
637
                        principalTable: "AbpUsers",
638
                        principalColumn: "Id",
639
                        onDelete: ReferentialAction.Cascade);
640
                });
641

642
            migrationBuilder.CreateTable(
643
                name: "AbpUserRoles",
644
                columns: table => new
645
                {
646
                    UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
647
                    RoleId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
648
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
649
                },
650
                constraints: table =>
651
                {
652
                    table.PrimaryKey("PK_AbpUserRoles", x => new { x.UserId, x.RoleId });
653
                    table.ForeignKey(
654
                        name: "FK_AbpUserRoles_AbpRoles_RoleId",
655
                        column: x => x.RoleId,
656
                        principalTable: "AbpRoles",
657
                        principalColumn: "Id",
658
                        onDelete: ReferentialAction.Cascade);
659
                    table.ForeignKey(
660
                        name: "FK_AbpUserRoles_AbpUsers_UserId",
661
                        column: x => x.UserId,
662
                        principalTable: "AbpUsers",
663
                        principalColumn: "Id",
664
                        onDelete: ReferentialAction.Cascade);
665
                });
666

667
            migrationBuilder.CreateTable(
668
                name: "AbpUserTokens",
669
                columns: table => new
670
                {
671
                    UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
672
                    LoginProvider = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
673
                    Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
674
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
675
                    Value = table.Column<string>(type: "nvarchar(max)", nullable: true)
676
                },
677
                constraints: table =>
678
                {
679
                    table.PrimaryKey("PK_AbpUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
680
                    table.ForeignKey(
681
                        name: "FK_AbpUserTokens_AbpUsers_UserId",
682
                        column: x => x.UserId,
683
                        principalTable: "AbpUsers",
684
                        principalColumn: "Id",
685
                        onDelete: ReferentialAction.Cascade);
686
                });
687

688
            migrationBuilder.CreateTable(
689
                name: "OpenIddictAuthorizations",
690
                columns: table => new
691
                {
692
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
693
                    ApplicationId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
694
                    CreationDate = table.Column<DateTime>(type: "datetime2", nullable: true),
695
                    Properties = table.Column<string>(type: "nvarchar(max)", nullable: true),
696
                    Scopes = table.Column<string>(type: "nvarchar(max)", nullable: true),
697
                    Status = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
698
                    Subject = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: true),
699
                    Type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
700
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
701
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
702
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
703
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
704
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
705
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
706
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
707
                    DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
708
                    DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
709
                },
710
                constraints: table =>
711
                {
712
                    table.PrimaryKey("PK_OpenIddictAuthorizations", x => x.Id);
713
                    table.ForeignKey(
714
                        name: "FK_OpenIddictAuthorizations_OpenIddictApplications_ApplicationId",
715
                        column: x => x.ApplicationId,
716
                        principalTable: "OpenIddictApplications",
717
                        principalColumn: "Id");
718
                });
719

720
            migrationBuilder.CreateTable(
721
                name: "AbpEntityPropertyChanges",
722
                columns: table => new
723
                {
724
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
725
                    TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
726
                    EntityChangeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
727
                    NewValue = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
728
                    OriginalValue = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
729
                    PropertyName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
730
                    PropertyTypeFullName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false)
731
                },
732
                constraints: table =>
733
                {
734
                    table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id);
735
                    table.ForeignKey(
736
                        name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId",
737
                        column: x => x.EntityChangeId,
738
                        principalTable: "AbpEntityChanges",
739
                        principalColumn: "Id",
740
                        onDelete: ReferentialAction.Cascade);
741
                });
742

743
            migrationBuilder.CreateTable(
744
                name: "OpenIddictTokens",
745
                columns: table => new
746
                {
747
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
748
                    ApplicationId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
749
                    AuthorizationId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
750
                    CreationDate = table.Column<DateTime>(type: "datetime2", nullable: true),
751
                    ExpirationDate = table.Column<DateTime>(type: "datetime2", nullable: true),
752
                    Payload = table.Column<string>(type: "nvarchar(max)", nullable: true),
753
                    Properties = table.Column<string>(type: "nvarchar(max)", nullable: true),
754
                    RedemptionDate = table.Column<DateTime>(type: "datetime2", nullable: true),
755
                    ReferenceId = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
756
                    Status = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
757
                    Subject = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: true),
758
                    Type = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
759
                    ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
760
                    ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false),
761
                    CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
762
                    CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
763
                    LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
764
                    LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
765
                    IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
766
                    DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
767
                    DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
768
                },
769
                constraints: table =>
770
                {
771
                    table.PrimaryKey("PK_OpenIddictTokens", x => x.Id);
772
                    table.ForeignKey(
773
                        name: "FK_OpenIddictTokens_OpenIddictApplications_ApplicationId",
774
                        column: x => x.ApplicationId,
775
                        principalTable: "OpenIddictApplications",
776
                        principalColumn: "Id");
777
                    table.ForeignKey(
778
                        name: "FK_OpenIddictTokens_OpenIddictAuthorizations_AuthorizationId",
779
                        column: x => x.AuthorizationId,
780
                        principalTable: "OpenIddictAuthorizations",
781
                        principalColumn: "Id");
782
                });
783

784
            migrationBuilder.CreateIndex(
785
                name: "IX_AbpAuditLogActions_AuditLogId",
786
                table: "AbpAuditLogActions",
787
                column: "AuditLogId");
788

789
            migrationBuilder.CreateIndex(
790
                name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_ExecutionTime",
791
                table: "AbpAuditLogActions",
792
                columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" });
793

794
            migrationBuilder.CreateIndex(
795
                name: "IX_AbpAuditLogs_TenantId_ExecutionTime",
796
                table: "AbpAuditLogs",
797
                columns: new[] { "TenantId", "ExecutionTime" });
798

799
            migrationBuilder.CreateIndex(
800
                name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime",
801
                table: "AbpAuditLogs",
802
                columns: new[] { "TenantId", "UserId", "ExecutionTime" });
803

804
            migrationBuilder.CreateIndex(
805
                name: "IX_AbpEntityChanges_AuditLogId",
806
                table: "AbpEntityChanges",
807
                column: "AuditLogId");
808

809
            migrationBuilder.CreateIndex(
810
                name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId",
811
                table: "AbpEntityChanges",
812
                columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" });
813

814
            migrationBuilder.CreateIndex(
815
                name: "IX_AbpEntityPropertyChanges_EntityChangeId",
816
                table: "AbpEntityPropertyChanges",
817
                column: "EntityChangeId");
818

819
            migrationBuilder.CreateIndex(
820
                name: "IX_AbpFeatureGroups_Name",
821
                table: "AbpFeatureGroups",
822
                column: "Name",
823
                unique: true);
824

825
            migrationBuilder.CreateIndex(
826
                name: "IX_AbpFeatures_GroupName",
827
                table: "AbpFeatures",
828
                column: "GroupName");
829

830
            migrationBuilder.CreateIndex(
831
                name: "IX_AbpFeatures_Name",
832
                table: "AbpFeatures",
833
                column: "Name",
834
                unique: true);
835

836
            migrationBuilder.CreateIndex(
837
                name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey",
838
                table: "AbpFeatureValues",
839
                columns: new[] { "Name", "ProviderName", "ProviderKey" },
840
                unique: true,
841
                filter: "[ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL");
842

843
            migrationBuilder.CreateIndex(
844
                name: "IX_AbpLinkUsers_SourceUserId_SourceTenantId_TargetUserId_TargetTenantId",
845
                table: "AbpLinkUsers",
846
                columns: new[] { "SourceUserId", "SourceTenantId", "TargetUserId", "TargetTenantId" },
847
                unique: true,
848
                filter: "[SourceTenantId] IS NOT NULL AND [TargetTenantId] IS NOT NULL");
849

850
            migrationBuilder.CreateIndex(
851
                name: "IX_AbpOrganizationUnitRoles_RoleId_OrganizationUnitId",
852
                table: "AbpOrganizationUnitRoles",
853
                columns: new[] { "RoleId", "OrganizationUnitId" });
854

855
            migrationBuilder.CreateIndex(
856
                name: "IX_AbpOrganizationUnits_Code",
857
                table: "AbpOrganizationUnits",
858
                column: "Code");
859

860
            migrationBuilder.CreateIndex(
861
                name: "IX_AbpOrganizationUnits_ParentId",
862
                table: "AbpOrganizationUnits",
863
                column: "ParentId");
864

865
            migrationBuilder.CreateIndex(
866
                name: "IX_AbpPermissionGrants_TenantId_Name_ProviderName_ProviderKey",
867
                table: "AbpPermissionGrants",
868
                columns: new[] { "TenantId", "Name", "ProviderName", "ProviderKey" },
869
                unique: true,
870
                filter: "[TenantId] IS NOT NULL");
871

872
            migrationBuilder.CreateIndex(
873
                name: "IX_AbpPermissionGroups_Name",
874
                table: "AbpPermissionGroups",
875
                column: "Name",
876
                unique: true);
877

878
            migrationBuilder.CreateIndex(
879
                name: "IX_AbpPermissions_GroupName",
880
                table: "AbpPermissions",
881
                column: "GroupName");
882

883
            migrationBuilder.CreateIndex(
884
                name: "IX_AbpPermissions_Name",
885
                table: "AbpPermissions",
886
                column: "Name",
887
                unique: true);
888

889
            migrationBuilder.CreateIndex(
890
                name: "IX_AbpRoleClaims_RoleId",
891
                table: "AbpRoleClaims",
892
                column: "RoleId");
893

894
            migrationBuilder.CreateIndex(
895
                name: "IX_AbpRoles_NormalizedName",
896
                table: "AbpRoles",
897
                column: "NormalizedName");
898

899
            migrationBuilder.CreateIndex(
900
                name: "IX_AbpSecurityLogs_TenantId_Action",
901
                table: "AbpSecurityLogs",
902
                columns: new[] { "TenantId", "Action" });
903

904
            migrationBuilder.CreateIndex(
905
                name: "IX_AbpSecurityLogs_TenantId_ApplicationName",
906
                table: "AbpSecurityLogs",
907
                columns: new[] { "TenantId", "ApplicationName" });
908

909
            migrationBuilder.CreateIndex(
910
                name: "IX_AbpSecurityLogs_TenantId_Identity",
911
                table: "AbpSecurityLogs",
912
                columns: new[] { "TenantId", "Identity" });
913

914
            migrationBuilder.CreateIndex(
915
                name: "IX_AbpSecurityLogs_TenantId_UserId",
916
                table: "AbpSecurityLogs",
917
                columns: new[] { "TenantId", "UserId" });
918

919
            migrationBuilder.CreateIndex(
920
                name: "IX_AbpSessions_Device",
921
                table: "AbpSessions",
922
                column: "Device");
923

924
            migrationBuilder.CreateIndex(
925
                name: "IX_AbpSessions_SessionId",
926
                table: "AbpSessions",
927
                column: "SessionId");
928

929
            migrationBuilder.CreateIndex(
930
                name: "IX_AbpSessions_TenantId_UserId",
931
                table: "AbpSessions",
932
                columns: new[] { "TenantId", "UserId" });
933

934
            migrationBuilder.CreateIndex(
935
                name: "IX_AbpSettingDefinitions_Name",
936
                table: "AbpSettingDefinitions",
937
                column: "Name",
938
                unique: true);
939

940
            migrationBuilder.CreateIndex(
941
                name: "IX_AbpSettings_Name_ProviderName_ProviderKey",
942
                table: "AbpSettings",
943
                columns: new[] { "Name", "ProviderName", "ProviderKey" },
944
                unique: true,
945
                filter: "[ProviderName] IS NOT NULL AND [ProviderKey] IS NOT NULL");
946

947
            migrationBuilder.CreateIndex(
948
                name: "IX_AbpTenants_Name",
949
                table: "AbpTenants",
950
                column: "Name");
951

952
            migrationBuilder.CreateIndex(
953
                name: "IX_AbpTenants_NormalizedName",
954
                table: "AbpTenants",
955
                column: "NormalizedName");
956

957
            migrationBuilder.CreateIndex(
958
                name: "IX_AbpUserClaims_UserId",
959
                table: "AbpUserClaims",
960
                column: "UserId");
961

962
            migrationBuilder.CreateIndex(
963
                name: "IX_AbpUserLogins_LoginProvider_ProviderKey",
964
                table: "AbpUserLogins",
965
                columns: new[] { "LoginProvider", "ProviderKey" });
966

967
            migrationBuilder.CreateIndex(
968
                name: "IX_AbpUserOrganizationUnits_UserId_OrganizationUnitId",
969
                table: "AbpUserOrganizationUnits",
970
                columns: new[] { "UserId", "OrganizationUnitId" });
971

972
            migrationBuilder.CreateIndex(
973
                name: "IX_AbpUserRoles_RoleId_UserId",
974
                table: "AbpUserRoles",
975
                columns: new[] { "RoleId", "UserId" });
976

977
            migrationBuilder.CreateIndex(
978
                name: "IX_AbpUsers_Email",
979
                table: "AbpUsers",
980
                column: "Email");
981

982
            migrationBuilder.CreateIndex(
983
                name: "IX_AbpUsers_NormalizedEmail",
984
                table: "AbpUsers",
985
                column: "NormalizedEmail");
986

987
            migrationBuilder.CreateIndex(
988
                name: "IX_AbpUsers_NormalizedUserName",
989
                table: "AbpUsers",
990
                column: "NormalizedUserName");
991

992
            migrationBuilder.CreateIndex(
993
                name: "IX_AbpUsers_UserName",
994
                table: "AbpUsers",
995
                column: "UserName");
996

997
            migrationBuilder.CreateIndex(
998
                name: "IX_OpenIddictApplications_ClientId",
999
                table: "OpenIddictApplications",
1000
                column: "ClientId");
1001

1002
            migrationBuilder.CreateIndex(
1003
                name: "IX_OpenIddictAuthorizations_ApplicationId_Status_Subject_Type",
1004
                table: "OpenIddictAuthorizations",
1005
                columns: new[] { "ApplicationId", "Status", "Subject", "Type" });
1006

1007
            migrationBuilder.CreateIndex(
1008
                name: "IX_OpenIddictScopes_Name",
1009
                table: "OpenIddictScopes",
1010
                column: "Name");
1011

1012
            migrationBuilder.CreateIndex(
1013
                name: "IX_OpenIddictTokens_ApplicationId_Status_Subject_Type",
1014
                table: "OpenIddictTokens",
1015
                columns: new[] { "ApplicationId", "Status", "Subject", "Type" });
1016

1017
            migrationBuilder.CreateIndex(
1018
                name: "IX_OpenIddictTokens_AuthorizationId",
1019
                table: "OpenIddictTokens",
1020
                column: "AuthorizationId");
1021

1022
            migrationBuilder.CreateIndex(
1023
                name: "IX_OpenIddictTokens_ReferenceId",
1024
                table: "OpenIddictTokens",
1025
                column: "ReferenceId");
1026
        }
1027

1028
        /// <inheritdoc />
1029
        protected override void Down(MigrationBuilder migrationBuilder)
1030
        {
1031
            migrationBuilder.DropTable(
1032
                name: "AbpAuditLogActions");
1033

1034
            migrationBuilder.DropTable(
1035
                name: "AbpClaimTypes");
1036

1037
            migrationBuilder.DropTable(
1038
                name: "AbpEntityPropertyChanges");
1039

1040
            migrationBuilder.DropTable(
1041
                name: "AbpFeatureGroups");
1042

1043
            migrationBuilder.DropTable(
1044
                name: "AbpFeatures");
1045

1046
            migrationBuilder.DropTable(
1047
                name: "AbpFeatureValues");
1048

1049
            migrationBuilder.DropTable(
1050
                name: "AbpLinkUsers");
1051

1052
            migrationBuilder.DropTable(
1053
                name: "AbpOrganizationUnitRoles");
1054

1055
            migrationBuilder.DropTable(
1056
                name: "AbpPermissionGrants");
1057

1058
            migrationBuilder.DropTable(
1059
                name: "AbpPermissionGroups");
1060

1061
            migrationBuilder.DropTable(
1062
                name: "AbpPermissions");
1063

1064
            migrationBuilder.DropTable(
1065
                name: "AbpRoleClaims");
1066

1067
            migrationBuilder.DropTable(
1068
                name: "AbpSecurityLogs");
1069

1070
            migrationBuilder.DropTable(
1071
                name: "AbpSessions");
1072

1073
            migrationBuilder.DropTable(
1074
                name: "AbpSettingDefinitions");
1075

1076
            migrationBuilder.DropTable(
1077
                name: "AbpSettings");
1078

1079
            migrationBuilder.DropTable(
1080
                name: "AbpTenantConnectionStrings");
1081

1082
            migrationBuilder.DropTable(
1083
                name: "AbpUserClaims");
1084

1085
            migrationBuilder.DropTable(
1086
                name: "AbpUserDelegations");
1087

1088
            migrationBuilder.DropTable(
1089
                name: "AbpUserLogins");
1090

1091
            migrationBuilder.DropTable(
1092
                name: "AbpUserOrganizationUnits");
1093

1094
            migrationBuilder.DropTable(
1095
                name: "AbpUserRoles");
1096

1097
            migrationBuilder.DropTable(
1098
                name: "AbpUserTokens");
1099

1100
            migrationBuilder.DropTable(
1101
                name: "OpenIddictScopes");
1102

1103
            migrationBuilder.DropTable(
1104
                name: "OpenIddictTokens");
1105

1106
            migrationBuilder.DropTable(
1107
                name: "AbpEntityChanges");
1108

1109
            migrationBuilder.DropTable(
1110
                name: "AbpTenants");
1111

1112
            migrationBuilder.DropTable(
1113
                name: "AbpOrganizationUnits");
1114

1115
            migrationBuilder.DropTable(
1116
                name: "AbpRoles");
1117

1118
            migrationBuilder.DropTable(
1119
                name: "AbpUsers");
1120

1121
            migrationBuilder.DropTable(
1122
                name: "OpenIddictAuthorizations");
1123

1124
            migrationBuilder.DropTable(
1125
                name: "AbpAuditLogs");
1126

1127
            migrationBuilder.DropTable(
1128
                name: "OpenIddictApplications");
1129
        }
1130
    }
1131
}
1132

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.