Skip to content

Commit b6b437f

Browse files
committed
DisallowedAssets DB migration
1 parent 4a07171 commit b6b437f

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
using Microsoft.EntityFrameworkCore.Infrastructure;
2+
using Microsoft.EntityFrameworkCore.Migrations;
3+
4+
#nullable disable
5+
6+
namespace Refresh.Database.Migrations
7+
{
8+
/// <inheritdoc />
9+
[DbContext(typeof(GameDatabaseContext))]
10+
[Migration("20260411153651_AddAbilityToDisallowAssets")]
11+
public partial class AddAbilityToDisallowAssets : Migration
12+
{
13+
/// <inheritdoc />
14+
protected override void Up(MigrationBuilder migrationBuilder)
15+
{
16+
migrationBuilder.CreateTable(
17+
name: "DisallowedAssets",
18+
columns: table => new
19+
{
20+
AssetHash = table.Column<string>(type: "text", nullable: false),
21+
AssetType = table.Column<int>(type: "integer", nullable: false),
22+
Reason = table.Column<string>(type: "text", nullable: false),
23+
DisallowedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false)
24+
},
25+
constraints: table =>
26+
{
27+
table.PrimaryKey("PK_DisallowedAssets", x => x.AssetHash);
28+
});
29+
}
30+
31+
/// <inheritdoc />
32+
protected override void Down(MigrationBuilder migrationBuilder)
33+
{
34+
migrationBuilder.DropTable(
35+
name: "DisallowedAssets");
36+
}
37+
}
38+
}

Refresh.Database/Migrations/GameDatabaseContextModelSnapshot.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,26 @@ protected override void BuildModel(ModelBuilder modelBuilder)
2323

2424
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
2525

26+
modelBuilder.Entity("DisallowedAsset", b =>
27+
{
28+
b.Property<string>("AssetHash")
29+
.HasColumnType("text");
30+
31+
b.Property<int>("AssetType")
32+
.HasColumnType("integer");
33+
34+
b.Property<DateTimeOffset>("DisallowedAt")
35+
.HasColumnType("timestamp with time zone");
36+
37+
b.Property<string>("Reason")
38+
.IsRequired()
39+
.HasColumnType("text");
40+
41+
b.HasKey("AssetHash");
42+
43+
b.ToTable("DisallowedAssets");
44+
});
45+
2646
modelBuilder.Entity("Refresh.Database.Models.Activity.Event", b =>
2747
{
2848
b.Property<string>("EventId")

0 commit comments

Comments
 (0)