-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consumer API: Make File's Owner and OwnerSignature required (#503)
* Change Base64 strings to byte arrays in DTO * Make non-null fields required in data classes * Add PropertyGroup Nullable to File projects * Remove call to deleted script * Make Owner and OwnerSignature required, validate it correctly * Make DeletedBy null in response * Add DB migration to make Owner property non-null with default value of "" * Fix Schroedinger's Whitespace (File was not completely CRLF) * Make OwnerSignature, CipherHash and EncryptedProperties base64 strings again * Remove trailing whitespace
- Loading branch information
1 parent
1ca8f29
commit c2d56fc
Showing
17 changed files
with
380 additions
and
39 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
119 changes: 119 additions & 0 deletions
119
....Database.Postgres/Migrations/20240124085123_SetOwnerRequiredWithDefaultValue.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
48 changes: 48 additions & 0 deletions
48
...structure.Database.Postgres/Migrations/20240124085123_SetOwnerRequiredWithDefaultValue.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,48 @@ | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace Backbone.Modules.Files.Infrastructure.Database.Postgres.Migrations | ||
{ | ||
/// <inheritdoc /> | ||
public partial class SetOwnerRequiredWithDefaultValue : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.AlterColumn<string>( | ||
name: "Owner", | ||
table: "FileMetadata", | ||
type: "character(36)", | ||
unicode: false, | ||
fixedLength: true, | ||
maxLength: 36, | ||
nullable: false, | ||
defaultValue: "", | ||
oldClrType: typeof(string), | ||
oldType: "character(36)", | ||
oldUnicode: false, | ||
oldFixedLength: true, | ||
oldMaxLength: 36, | ||
oldNullable: true); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.AlterColumn<string>( | ||
name: "Owner", | ||
table: "FileMetadata", | ||
type: "character(36)", | ||
unicode: false, | ||
fixedLength: true, | ||
maxLength: 36, | ||
nullable: true, | ||
oldClrType: typeof(string), | ||
oldType: "character(36)", | ||
oldUnicode: false, | ||
oldFixedLength: true, | ||
oldMaxLength: 36); | ||
} | ||
} | ||
} |
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.