-
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.
Merge branch 'main' into do-not-create-external-events-for-identity-d…
…eletion-if-change-was-initiated-by-owner
- Loading branch information
Showing
38 changed files
with
1,942 additions
and
429 deletions.
There are no files selected for viewing
256 changes: 256 additions & 0 deletions
256
...i.Infrastructure.Database.Postgres/Migrations/20240110182619_MessagesOverview.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
...c/AdminApi.Infrastructure.Database.Postgres/Migrations/20240110182619_MessagesOverview.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,38 @@ | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace Backbone.AdminApi.Infrastructure.Database.Postgres.Migrations | ||
{ | ||
/// <inheritdoc /> | ||
public partial class MessagesOverview : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.Sql(""" | ||
CREATE VIEW "AdminUi"."MessageOverviews" AS | ||
SELECT | ||
"Messages"."Id" AS "MessageId", | ||
"Messages"."CreatedBy" AS "SenderAddress", | ||
"Messages"."CreatedByDevice" AS "SenderDevice", | ||
"Messages"."CreatedAt" AS "SendDate", | ||
COUNT ("Attachments"."Id") AS "NumberOfAttachments" | ||
FROM | ||
"Messages"."Messages" AS "Messages" | ||
LEFT JOIN | ||
"Messages"."Attachments" AS "Attachments" | ||
ON | ||
"Messages"."Id" = "Attachments"."MessageId" | ||
GROUP BY | ||
"Messages"."Id", "Messages"."CreatedBy", "Messages"."CreatedByDevice", "Messages"."CreatedAt" | ||
"""); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.Sql(""" DROP VIEW "AdminUi"."MessageOverviews" """); | ||
} | ||
} | ||
} |
Oops, something went wrong.