-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #115 from EasyAbp/fix-unique-index
Introduce `SoftDeletionToken` and fix indexes
- Loading branch information
Showing
14 changed files
with
3,684 additions
and
14 deletions.
There are no files selected for viewing
1,632 changes: 1,632 additions & 0 deletions
1,632
...t.Blazor.Server.Host/Migrations/20231218145009_AddedSoftDeletionTokenProperty.Designer.cs
Large diffs are not rendered by default.
Oops, something went wrong.
67 changes: 67 additions & 0 deletions
67
...Management.Blazor.Server.Host/Migrations/20231218145009_AddedSoftDeletionTokenProperty.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace EasyAbp.FileManagement.Blazor.Server.Host.Migrations | ||
{ | ||
/// <inheritdoc /> | ||
public partial class AddedSoftDeletionTokenProperty : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropIndex( | ||
name: "IX_EasyAbpFileManagementFiles_FileName_ParentId_OwnerUserId_FileContainerName", | ||
table: "EasyAbpFileManagementFiles"); | ||
|
||
migrationBuilder.DropIndex( | ||
name: "IX_EasyAbpFileManagementFiles_ParentId_OwnerUserId_FileContainerName", | ||
table: "EasyAbpFileManagementFiles"); | ||
|
||
migrationBuilder.AddColumn<string>( | ||
name: "SoftDeletionToken", | ||
table: "EasyAbpFileManagementFiles", | ||
type: "nvarchar(450)", | ||
nullable: true); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_EasyAbpFileManagementFiles_FileName_ParentId_OwnerUserId_FileContainerName_TenantId_SoftDeletionToken", | ||
table: "EasyAbpFileManagementFiles", | ||
columns: new[] { "FileName", "ParentId", "OwnerUserId", "FileContainerName", "TenantId", "SoftDeletionToken" }, | ||
unique: true); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_EasyAbpFileManagementFiles_ParentId_OwnerUserId_FileContainerName_FileName", | ||
table: "EasyAbpFileManagementFiles", | ||
columns: new[] { "ParentId", "OwnerUserId", "FileContainerName", "FileName" }); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropIndex( | ||
name: "IX_EasyAbpFileManagementFiles_FileName_ParentId_OwnerUserId_FileContainerName_TenantId_SoftDeletionToken", | ||
table: "EasyAbpFileManagementFiles"); | ||
|
||
migrationBuilder.DropIndex( | ||
name: "IX_EasyAbpFileManagementFiles_ParentId_OwnerUserId_FileContainerName_FileName", | ||
table: "EasyAbpFileManagementFiles"); | ||
|
||
migrationBuilder.DropColumn( | ||
name: "SoftDeletionToken", | ||
table: "EasyAbpFileManagementFiles"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_EasyAbpFileManagementFiles_FileName_ParentId_OwnerUserId_FileContainerName", | ||
table: "EasyAbpFileManagementFiles", | ||
columns: new[] { "FileName", "ParentId", "OwnerUserId", "FileContainerName" }, | ||
unique: true, | ||
filter: "[FileName] IS NOT NULL AND [ParentId] IS NOT NULL AND [OwnerUserId] IS NOT NULL AND [FileContainerName] IS NOT NULL"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_EasyAbpFileManagementFiles_ParentId_OwnerUserId_FileContainerName", | ||
table: "EasyAbpFileManagementFiles", | ||
columns: new[] { "ParentId", "OwnerUserId", "FileContainerName" }); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
140 changes: 140 additions & 0 deletions
140
...agement.HttpApi.Host/Migrations/20231218144924_AddedSoftDeletionTokenProperty.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
67 changes: 67 additions & 0 deletions
67
...p.FileManagement.HttpApi.Host/Migrations/20231218144924_AddedSoftDeletionTokenProperty.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace EasyAbp.FileManagement.Migrations | ||
{ | ||
/// <inheritdoc /> | ||
public partial class AddedSoftDeletionTokenProperty : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropIndex( | ||
name: "IX_EasyAbpFileManagementFiles_FileName_ParentId_OwnerUserId_FileContainerName", | ||
table: "EasyAbpFileManagementFiles"); | ||
|
||
migrationBuilder.DropIndex( | ||
name: "IX_EasyAbpFileManagementFiles_ParentId_OwnerUserId_FileContainerName", | ||
table: "EasyAbpFileManagementFiles"); | ||
|
||
migrationBuilder.AddColumn<string>( | ||
name: "SoftDeletionToken", | ||
table: "EasyAbpFileManagementFiles", | ||
type: "nvarchar(450)", | ||
nullable: true); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_EasyAbpFileManagementFiles_FileName_ParentId_OwnerUserId_FileContainerName_TenantId_SoftDeletionToken", | ||
table: "EasyAbpFileManagementFiles", | ||
columns: new[] { "FileName", "ParentId", "OwnerUserId", "FileContainerName", "TenantId", "SoftDeletionToken" }, | ||
unique: true); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_EasyAbpFileManagementFiles_ParentId_OwnerUserId_FileContainerName_FileName", | ||
table: "EasyAbpFileManagementFiles", | ||
columns: new[] { "ParentId", "OwnerUserId", "FileContainerName", "FileName" }); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropIndex( | ||
name: "IX_EasyAbpFileManagementFiles_FileName_ParentId_OwnerUserId_FileContainerName_TenantId_SoftDeletionToken", | ||
table: "EasyAbpFileManagementFiles"); | ||
|
||
migrationBuilder.DropIndex( | ||
name: "IX_EasyAbpFileManagementFiles_ParentId_OwnerUserId_FileContainerName_FileName", | ||
table: "EasyAbpFileManagementFiles"); | ||
|
||
migrationBuilder.DropColumn( | ||
name: "SoftDeletionToken", | ||
table: "EasyAbpFileManagementFiles"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_EasyAbpFileManagementFiles_FileName_ParentId_OwnerUserId_FileContainerName", | ||
table: "EasyAbpFileManagementFiles", | ||
columns: new[] { "FileName", "ParentId", "OwnerUserId", "FileContainerName" }, | ||
unique: true, | ||
filter: "[FileName] IS NOT NULL AND [ParentId] IS NOT NULL AND [OwnerUserId] IS NOT NULL AND [FileContainerName] IS NOT NULL"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_EasyAbpFileManagementFiles_ParentId_OwnerUserId_FileContainerName", | ||
table: "EasyAbpFileManagementFiles", | ||
columns: new[] { "ParentId", "OwnerUserId", "FileContainerName" }); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.