Remove autogenerated from admin log key. (#18377)
This commit is contained in:
committed by
GitHub
parent
253136b0b6
commit
7c9d7423d2
1767
Content.Server.Database/Migrations/Postgres/20230727190902_AdminLogCompoundKey.Designer.cs
generated
Normal file
1767
Content.Server.Database/Migrations/Postgres/20230727190902_AdminLogCompoundKey.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,37 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Content.Server.Database.Migrations.Postgres
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AdminLogCompoundKey : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "admin_log_id",
|
||||||
|
table: "admin_log",
|
||||||
|
type: "integer",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "integer")
|
||||||
|
.OldAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AlterColumn<int>(
|
||||||
|
name: "admin_log_id",
|
||||||
|
table: "admin_log",
|
||||||
|
type: "integer",
|
||||||
|
nullable: false,
|
||||||
|
oldClrType: typeof(int),
|
||||||
|
oldType: "integer")
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -85,12 +85,9 @@ namespace Content.Server.Database.Migrations.Postgres
|
|||||||
modelBuilder.Entity("Content.Server.Database.AdminLog", b =>
|
modelBuilder.Entity("Content.Server.Database.AdminLog", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasColumnName("admin_log_id");
|
.HasColumnName("admin_log_id");
|
||||||
|
|
||||||
NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property<int>("Id"));
|
|
||||||
|
|
||||||
b.Property<int>("RoundId")
|
b.Property<int>("RoundId")
|
||||||
.HasColumnType("integer")
|
.HasColumnType("integer")
|
||||||
.HasColumnName("round_id");
|
.HasColumnName("round_id");
|
||||||
|
|||||||
1697
Content.Server.Database/Migrations/Sqlite/20230727190858_AdminLogCompoundKey.Designer.cs
generated
Normal file
1697
Content.Server.Database/Migrations/Sqlite/20230727190858_AdminLogCompoundKey.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,22 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Content.Server.Database.Migrations.Sqlite
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class AdminLogCompoundKey : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -76,7 +76,6 @@ namespace Content.Server.Database.Migrations.Sqlite
|
|||||||
modelBuilder.Entity("Content.Server.Database.AdminLog", b =>
|
modelBuilder.Entity("Content.Server.Database.AdminLog", b =>
|
||||||
{
|
{
|
||||||
b.Property<int>("Id")
|
b.Property<int>("Id")
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnType("INTEGER")
|
.HasColumnType("INTEGER")
|
||||||
.HasColumnName("admin_log_id");
|
.HasColumnName("admin_log_id");
|
||||||
|
|
||||||
|
|||||||
@@ -96,8 +96,7 @@ namespace Content.Server.Database
|
|||||||
.HasKey(log => new {log.Id, log.RoundId});
|
.HasKey(log => new {log.Id, log.RoundId});
|
||||||
|
|
||||||
modelBuilder.Entity<AdminLog>()
|
modelBuilder.Entity<AdminLog>()
|
||||||
.Property(log => log.Id)
|
.Property(log => log.Id);
|
||||||
.ValueGeneratedOnAdd();
|
|
||||||
|
|
||||||
modelBuilder.Entity<AdminLog>()
|
modelBuilder.Entity<AdminLog>()
|
||||||
.HasIndex(log => log.Date);
|
.HasIndex(log => log.Date);
|
||||||
@@ -491,7 +490,7 @@ namespace Content.Server.Database
|
|||||||
[Index(nameof(Type))]
|
[Index(nameof(Type))]
|
||||||
public class AdminLog
|
public class AdminLog
|
||||||
{
|
{
|
||||||
[Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[Key]
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
[Key, ForeignKey("Round")] public int RoundId { get; set; }
|
[Key, ForeignKey("Round")] public int RoundId { get; set; }
|
||||||
|
|||||||
Reference in New Issue
Block a user