Changing to database schema to ensure separations of concerns instead of connection string

This commit is contained in:
Jonathan Bourdon
2024-07-06 23:12:39 -04:00
parent ca94dba08d
commit f6a434c440
12 changed files with 211 additions and 12 deletions

View File

@@ -0,0 +1,42 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Hutopy.Web.Messages.Migrations
{
/// <inheritdoc />
public partial class ChangingMessagingDefaultSchema : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
name: "Messaging");
migrationBuilder.RenameTable(
name: "Messages",
newName: "Messages",
newSchema: "Messaging");
migrationBuilder.RenameColumn(
name: "ContentId",
schema: "Messaging",
table: "Messages",
newName: "SubjectId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameTable(
name: "Messages",
schema: "Messaging",
newName: "Messages");
migrationBuilder.RenameColumn(
name: "SubjectId",
table: "Messages",
newName: "ContentId");
}
}
}