[backend/database] Rename DataProtectionKeys table to data_protection_keys for consistency
This commit is contained in:
parent
8c5358efd9
commit
bee733b3da
3 changed files with 50 additions and 1 deletions
|
@ -1180,6 +1180,8 @@ public class DatabaseContext(DbContextOptions<DatabaseContext> options)
|
|||
entity.HasOne<Worker>().WithMany().HasForeignKey(d => d.WorkerId).OnDelete(DeleteBehavior.SetNull);
|
||||
});
|
||||
|
||||
modelBuilder.Entity<DataProtectionKey>().ToTable("data_protection_keys");
|
||||
|
||||
modelBuilder.ApplyConfigurationsFromAssembly(typeof(DatabaseContext).Assembly);
|
||||
}
|
||||
|
||||
|
|
|
@ -4859,7 +4859,7 @@ namespace Iceshrimp.Backend.Core.Database.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("DataProtectionKeys");
|
||||
b.ToTable("data_protection_keys", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Iceshrimp.Backend.Core.Database.Tables.AbuseUserReport", b =>
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Iceshrimp.Backend.Core.Database.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
[DbContext(typeof(DatabaseContext))]
|
||||
[Migration("20240428181455_RenameDataProtectionKeysTable")]
|
||||
public partial class RenameDataProtectionKeysTable : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_DataProtectionKeys",
|
||||
table: "DataProtectionKeys");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "DataProtectionKeys",
|
||||
newName: "data_protection_keys");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_data_protection_keys",
|
||||
table: "data_protection_keys",
|
||||
column: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropPrimaryKey(
|
||||
name: "PK_data_protection_keys",
|
||||
table: "data_protection_keys");
|
||||
|
||||
migrationBuilder.RenameTable(
|
||||
name: "data_protection_keys",
|
||||
newName: "DataProtectionKeys");
|
||||
|
||||
migrationBuilder.AddPrimaryKey(
|
||||
name: "PK_DataProtectionKeys",
|
||||
table: "DataProtectionKeys",
|
||||
column: "Id");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue