Add hex stalagmite support for tile bottom models

- TileBottomModel gains a Shape column (Square/Hex, default Square)
  so admins can manage separate stalagmite pools per tile grid type
- EF migration 20260407153312_AddTileBottomModelShape adds the column
  with a default of 'Square' to preserve existing data
- Admin UI splits the Tile Bottom Models section into Square and Hex
  cards, each with their own Add/toggle/delete controls
- content.tile_bottoms response now returns squareUrls and hexUrls
  separately; handler queries each shape independently
- ContentCache splits into _tile_bottom_urls_square / _hex and
  get_random_tile_bottom_url() now takes a shape parameter
- game_screen: hex tiles with no 3D model now receive a hex stalagmite
  instead of silently skipping; 3D-model path passes shape_key through

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
dingo
2026-04-07 11:34:46 -04:00
co-authored by Claude Happy
parent be8b1f7765
commit 4ac92d0139
10 changed files with 780 additions and 77 deletions
@@ -83,57 +83,64 @@ else
}
<!-- ── Tile Bottoms (stalagmite undersides) ── -->
<div class="card shadow-sm mb-4">
<div class="card-header fw-medium d-flex justify-content-between align-items-center">
<span>Tile Bottom Models <span class="text-muted small fw-normal">(stalagmites, randomly selected per tile)</span></span>
<button class="btn btn-sm btn-outline-primary" @onclick="OpenBottomPickerAsync">
<i class="bi bi-plus me-1"></i>Add
</button>
</div>
<div class="card-body p-0">
@if (_bottomModels.Count == 0)
{
<div class="text-muted text-center py-3 small">No bottom models yet — upload GLBs and add them here.</div>
}
else
{
<table class="table table-sm table-hover mb-0">
<thead class="table-light">
<tr>
<th>Model</th>
<th style="width:80px">Active</th>
<th style="width:100px"></th>
</tr>
</thead>
<tbody>
@foreach (var bottom in _bottomModels)
{
var b = bottom;
@foreach (var (shapeLabel, bottomShape) in new[] { ("Square", TileShape.Square), ("Hex", TileShape.Hex) })
{
var shapeModels = _bottomModels.Where(m => m.Shape == bottomShape).ToList();
<div class="card shadow-sm mb-4">
<div class="card-header fw-medium d-flex justify-content-between align-items-center">
<span>
Tile Bottom Models — <span class="badge bg-secondary">@shapeLabel</span>
<span class="text-muted small fw-normal ms-2">(stalagmites, randomly selected per @shapeLabel.ToLower() tile)</span>
</span>
<button class="btn btn-sm btn-outline-primary" @onclick="() => OpenBottomPickerAsync(bottomShape)">
<i class="bi bi-plus me-1"></i>Add
</button>
</div>
<div class="card-body p-0">
@if (shapeModels.Count == 0)
{
<div class="text-muted text-center py-3 small">No @shapeLabel.ToLower() bottom models yet — upload GLBs and add them here.</div>
}
else
{
<table class="table table-sm table-hover mb-0">
<thead class="table-light">
<tr>
<td class="align-middle font-monospace small text-break">
@(b.CdnKey.Contains('/') ? b.CdnKey[(b.CdnKey.LastIndexOf('/') + 1)..] : b.CdnKey)
</td>
<td class="align-middle">
<input type="checkbox" class="form-check-input" checked="@b.IsActive"
@onchange="e => ToggleBottomActiveAsync(b, (bool)e.Value!)" />
</td>
<td class="align-middle text-end pe-2">
<button class="btn btn-sm btn-outline-info py-0 me-1"
@onclick="() => _previewUrl = b.PublicUrl" title="Preview">
<i class="bi bi-box"></i>
</button>
<button class="btn btn-sm btn-outline-danger py-0"
@onclick="() => DeleteBottomAsync(b)" title="Delete">
<i class="bi bi-trash"></i>
</button>
</td>
<th>Model</th>
<th style="width:80px">Active</th>
<th style="width:100px"></th>
</tr>
}
</tbody>
</table>
}
</thead>
<tbody>
@foreach (var bottom in shapeModels)
{
var b = bottom;
<tr>
<td class="align-middle font-monospace small text-break">
@(b.CdnKey.Contains('/') ? b.CdnKey[(b.CdnKey.LastIndexOf('/') + 1)..] : b.CdnKey)
</td>
<td class="align-middle">
<input type="checkbox" class="form-check-input" checked="@b.IsActive"
@onchange="e => ToggleBottomActiveAsync(b, (bool)e.Value!)" />
</td>
<td class="align-middle text-end pe-2">
<button class="btn btn-sm btn-outline-info py-0 me-1"
@onclick="() => _previewUrl = b.PublicUrl" title="Preview">
<i class="bi bi-box"></i>
</button>
<button class="btn btn-sm btn-outline-danger py-0"
@onclick="() => DeleteBottomAsync(b)" title="Delete">
<i class="bi bi-trash"></i>
</button>
</td>
</tr>
}
</tbody>
</table>
}
</div>
</div>
</div>
}
<!-- Assign / Picker Modal -->
@if (_pickerOpen)
@@ -265,7 +272,7 @@ else
<div class="modal-dialog modal-xl modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Add Tile Bottom Model</h5>
<h5 class="modal-title">Add Tile Bottom Model <span class="badge bg-secondary ms-2">@_bottomPickerShape</span></h5>
<button type="button" class="btn-close" @onclick="() => _bottomPickerOpen = false"></button>
</div>
<div class="modal-body">
@@ -434,6 +441,7 @@ else
// Tile bottom models
private List<TileBottomModel> _bottomModels = new();
private bool _bottomPickerOpen;
private TileShape _bottomPickerShape = TileShape.Square;
private string _bottomPickerSearch = "";
private string? _bottomPickerSelected;
@@ -721,8 +729,9 @@ else
// ── Tile Bottom Models ────────────────────────────────────────────────────
private async Task OpenBottomPickerAsync()
private async Task OpenBottomPickerAsync(TileShape shape)
{
_bottomPickerShape = shape;
_bottomPickerSelected = null;
_bottomPickerSearch = "";
_bottomPickerOpen = true;
@@ -748,6 +757,7 @@ else
var publicUrl = BuildPublicUrl(options, _bottomPickerSelected);
var model = new TileBottomModel
{
Shape = _bottomPickerShape,
CdnKey = _bottomPickerSelected,
PublicUrl = publicUrl,
IsActive = true,
+1 -1
View File
@@ -35,7 +35,7 @@ public sealed record GetCardDefinitionResponse(CardDefinitionDto? Card);
public sealed record GetTileModelsResponse(IEnumerable<TileModelDto> Bindings);
public sealed record GetTileBottomsResponse(IEnumerable<string> Urls);
public sealed record GetTileBottomsResponse(IEnumerable<string> SquareUrls, IEnumerable<string> HexUrls);
public sealed record TileModelDto(
string Affinity,
@@ -2,13 +2,15 @@ namespace SOR.Content.Handlers;
using Microsoft.EntityFrameworkCore;
using SOR.Database.Contexts;
using SOR.Database.Enums;
using SOR.Networking.Abstractions.Messaging;
using SOR.Networking.Abstractions.Transport;
using SOR.Shared.Networking;
/// <summary>
/// content.tile_bottoms — returns CDN URLs for all active tile-bottom (stalagmite) models.
/// The client randomly picks from this list when attaching an underside mesh to a tile.
/// content.tile_bottoms — returns CDN URLs for all active tile-bottom (stalagmite) models,
/// split into square and hex pools. The client picks randomly from the pool matching the
/// current board's tile shape.
/// </summary>
internal sealed class ContentGetTileBottomsHandler : IMessageHandler
{
@@ -28,12 +30,17 @@ internal sealed class ContentGetTileBottomsHandler : IMessageHandler
AuthenticatedConnection connection,
CancellationToken ct)
{
var urls = await _catalogDb.TileBottomModels
.Where(m => m.IsActive)
var squareUrls = await _catalogDb.TileBottomModels
.Where(m => m.IsActive && m.Shape == TileShape.Square)
.Select(m => m.PublicUrl)
.ToListAsync(ct);
var hexUrls = await _catalogDb.TileBottomModels
.Where(m => m.IsActive && m.Shape == TileShape.Hex)
.Select(m => m.PublicUrl)
.ToListAsync(ct);
return ServerMessage.Reply("content.tile_bottoms.ack", message.Seq,
new GetTileBottomsResponse(urls));
new GetTileBottomsResponse(squareUrls, hexUrls));
}
}
@@ -149,9 +149,10 @@ public sealed class CatalogDbContext : DbContext
{
e.ToTable("tile_bottom_models");
e.HasKey(t => t.Id);
e.Property(t => t.Shape).HasConversion<string>().IsRequired();
e.Property(t => t.CdnKey).IsRequired();
e.Property(t => t.PublicUrl).IsRequired();
e.HasIndex(t => t.IsActive);
e.HasIndex(t => new { t.Shape, t.IsActive });
});
builder.Entity<GameAudioConfig>(e =>
@@ -1,13 +1,18 @@
namespace SOR.Database.Entities.Catalog;
using SOR.Database.Enums;
/// <summary>
/// A stalagmite / underside 3D model that the client attaches below tile models.
/// The client randomly picks from all active records each time a tile loads.
/// The client randomly picks from the active pool matching the board's tile shape.
/// </summary>
public sealed class TileBottomModel
{
public Guid Id { get; set; } = Guid.NewGuid();
/// <summary>Square or Hex — controls which pool this model belongs to.</summary>
public TileShape Shape { get; set; } = TileShape.Square;
/// <summary>S3 object key, e.g. "models/tiles/bottoms/stalactite_01.glb".</summary>
public string CdnKey { get; set; } = string.Empty;
@@ -0,0 +1,608 @@
// <auto-generated />
using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using SOR.Database.Contexts;
#nullable disable
namespace SOR.Database.Migrations.Catalog
{
[DbContext(typeof(CatalogDbContext))]
[Migration("20260407153312_AddTileBottomModelShape")]
partial class AddTileBottomModelShape
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasDefaultSchema("catalog")
.HasAnnotation("ProductVersion", "8.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("SOR.Database.Entities.Catalog.CardAnimationBinding", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("ActionName")
.IsRequired()
.HasColumnType("text");
b.Property<string>("AnimationCdnUrl")
.IsRequired()
.HasColumnType("text");
b.Property<string>("AnimationTrackName")
.HasColumnType("text");
b.Property<Guid>("CardDefinitionId")
.HasColumnType("uuid");
b.Property<string>("CastSoundCdnUrl")
.HasColumnType("text");
b.Property<string>("ImpactSoundCdnUrl")
.HasColumnType("text");
b.Property<bool>("IsAiGenerated")
.HasColumnType("boolean");
b.HasKey("Id");
b.HasIndex("CardDefinitionId", "ActionName")
.IsUnique();
b.ToTable("card_animation_bindings", "catalog");
});
modelBuilder.Entity("SOR.Database.Entities.Catalog.CardAsset", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("AssetType")
.IsRequired()
.HasColumnType("text");
b.Property<Guid>("CardDefinitionId")
.HasColumnType("uuid");
b.Property<string>("CdnUrl")
.IsRequired()
.HasColumnType("text");
b.Property<string>("ContentETag")
.HasColumnType("text");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<bool>("IsAiGenerated")
.HasColumnType("boolean");
b.Property<string>("MimeType")
.HasColumnType("text");
b.Property<string>("ModelFacingDirection")
.HasColumnType("text");
b.Property<string>("ModelTintMaskUrl")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("CardDefinitionId", "AssetType");
b.ToTable("card_assets", "catalog");
});
modelBuilder.Entity("SOR.Database.Entities.Catalog.CardDefinition", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("AbilitiesJson")
.HasColumnType("jsonb")
.HasColumnName("abilities");
b.Property<string>("Affinity")
.IsRequired()
.HasColumnType("text");
b.Property<string>("AttackSoundUrl")
.HasColumnType("text");
b.Property<string>("AttackType")
.HasColumnType("text");
b.Property<string>("BlockedSoundUrl")
.HasColumnType("text");
b.Property<bool?>("CanAttack")
.HasColumnType("boolean");
b.Property<bool?>("CanBeAttacked")
.HasColumnType("boolean");
b.Property<bool?>("CanBeBlocked")
.HasColumnType("boolean");
b.Property<bool?>("CanBeObstructed")
.HasColumnType("boolean");
b.Property<bool?>("CanBeSacrificed")
.HasColumnType("boolean");
b.Property<bool?>("CanDefend")
.HasColumnType("boolean");
b.Property<bool?>("CanMove")
.HasColumnType("boolean");
b.Property<bool?>("CanUseAbility")
.HasColumnType("boolean");
b.Property<string>("CardType")
.IsRequired()
.HasColumnType("text");
b.Property<int?>("CollectorNumber")
.HasColumnType("integer");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<int?>("Damage")
.HasColumnType("integer");
b.Property<string>("DamagedSoundUrl")
.HasColumnType("text");
b.Property<string>("DeathSoundUrl")
.HasColumnType("text");
b.Property<long>("DefinitionVersion")
.ValueGeneratedOnAdd()
.HasColumnType("bigint")
.HasDefaultValue(0L);
b.Property<string>("Description")
.IsRequired()
.HasColumnType("text");
b.Property<string>("EffectsJson")
.HasColumnType("jsonb")
.HasColumnName("effects");
b.Property<string[]>("Genus")
.HasColumnType("text[]");
b.Property<bool>("IsPublished")
.HasColumnType("boolean");
b.Property<bool>("IsRetired")
.HasColumnType("boolean");
b.Property<int?>("MaxAttackRange")
.HasColumnType("integer");
b.Property<int?>("MaxChannelRange")
.HasColumnType("integer");
b.Property<int?>("MaxDefense")
.HasColumnType("integer");
b.Property<int?>("MaxHealth")
.HasColumnType("integer");
b.Property<int?>("MinAttackRange")
.HasColumnType("integer");
b.Property<int?>("MinChannelRange")
.HasColumnType("integer");
b.Property<float?>("ModelScale")
.HasColumnType("real");
b.Property<string>("ModelTintColor")
.HasColumnType("text");
b.Property<string>("MoveSoundUrl")
.HasColumnType("text");
b.Property<int?>("MovementPoints")
.HasColumnType("integer");
b.Property<string>("MovementType")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("OtherCostsJson")
.HasColumnType("jsonb")
.HasColumnName("other_costs");
b.Property<Guid?>("PreviousTierId")
.HasColumnType("uuid");
b.Property<string>("Rarity")
.IsRequired()
.HasColumnType("text");
b.Property<bool?>("RequiresLos")
.HasColumnType("boolean");
b.Property<DateTimeOffset?>("RetiredAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid?>("SetId")
.HasColumnType("uuid");
b.Property<int>("SpCost")
.HasColumnType("integer");
b.Property<int>("StCost")
.HasColumnType("integer");
b.Property<string>("TerramorphaMode")
.HasColumnType("text");
b.Property<int?>("Tier")
.HasColumnType("integer");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("Affinity");
b.HasIndex("CardType");
b.HasIndex("DefinitionVersion");
b.HasIndex("Name");
b.HasIndex("PreviousTierId");
b.HasIndex("Rarity");
b.HasIndex("SetId");
b.HasIndex("IsPublished", "SetId");
b.ToTable("card_definitions", "catalog");
});
modelBuilder.Entity("SOR.Database.Entities.Catalog.CardSet", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Code")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Description")
.HasColumnType("text");
b.Property<bool>("IsActive")
.HasColumnType("boolean");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<DateOnly?>("ReleaseDate")
.HasColumnType("date");
b.HasKey("Id");
b.HasIndex("Code")
.IsUnique();
b.ToTable("card_sets", "catalog");
});
modelBuilder.Entity("SOR.Database.Entities.Catalog.CdnUploadRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("ContentType")
.HasColumnType("text");
b.Property<bool>("IsAiGenerated")
.HasColumnType("boolean");
b.Property<string>("ObjectKey")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Prefix")
.IsRequired()
.HasColumnType("text");
b.Property<string>("PublicUrl")
.IsRequired()
.HasColumnType("text");
b.Property<DateTimeOffset>("UploadedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("IsAiGenerated");
b.HasIndex("ObjectKey")
.IsUnique();
b.HasIndex("Prefix");
b.ToTable("cdn_upload_records", "catalog");
});
modelBuilder.Entity("SOR.Database.Entities.Catalog.GameAudioConfig", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Context")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("IsActive")
.HasColumnType("boolean");
b.Property<string>("TrackCdnUrl")
.IsRequired()
.HasColumnType("text");
b.Property<string>("TrackName")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("Context");
b.HasIndex("IsActive");
b.ToTable("game_audio_configs", "catalog");
});
modelBuilder.Entity("SOR.Database.Entities.Catalog.HighlightConfig", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("CdnPath")
.IsRequired()
.HasColumnType("text");
b.Property<string>("FallbackHex")
.IsRequired()
.HasColumnType("text");
b.Property<float>("Fps")
.HasColumnType("real");
b.Property<int>("FrameCount")
.HasColumnType("integer");
b.Property<string>("HighlightType")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("IsAnimated")
.HasColumnType("boolean");
b.HasKey("Id");
b.HasIndex("HighlightType")
.IsUnique();
b.ToTable("highlight_configs", "catalog");
});
modelBuilder.Entity("SOR.Database.Entities.Catalog.SkyboxDefinition", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("CdnPath")
.IsRequired()
.HasColumnType("text");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<string>("CubeNxUrl")
.HasColumnType("text")
.HasColumnName("cube_nx_url");
b.Property<string>("CubeNyUrl")
.HasColumnType("text")
.HasColumnName("cube_ny_url");
b.Property<string>("CubeNzUrl")
.HasColumnType("text")
.HasColumnName("cube_nz_url");
b.Property<string>("CubePxUrl")
.HasColumnType("text")
.HasColumnName("cube_px_url");
b.Property<string>("CubePyUrl")
.HasColumnType("text")
.HasColumnName("cube_py_url");
b.Property<string>("CubePzUrl")
.HasColumnType("text")
.HasColumnName("cube_pz_url");
b.Property<float>("Fps")
.HasColumnType("real");
b.Property<int>("FrameCount")
.HasColumnType("integer");
b.Property<bool>("IsActive")
.HasColumnType("boolean");
b.Property<bool>("IsAnimated")
.HasColumnType("boolean");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("SkyboxType")
.HasColumnType("text")
.HasColumnName("skybox_type");
b.HasKey("Id");
b.HasIndex("IsActive");
b.ToTable("skybox_definitions", "catalog");
});
modelBuilder.Entity("SOR.Database.Entities.Catalog.TileBottomModel", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("CdnKey")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("IsActive")
.HasColumnType("boolean");
b.Property<string>("PublicUrl")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Shape")
.IsRequired()
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("Shape", "IsActive");
b.ToTable("tile_bottom_models", "catalog");
});
modelBuilder.Entity("SOR.Database.Entities.Catalog.TileModelBinding", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Affinity")
.IsRequired()
.HasColumnType("text");
b.Property<string>("ModelCdnKey")
.IsRequired()
.HasColumnType("text");
b.Property<string>("ModelPublicUrl")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Shape")
.IsRequired()
.HasColumnType("text");
b.Property<string>("TexturePublicUrl")
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("Affinity", "Shape")
.IsUnique();
b.ToTable("tile_model_bindings", "catalog");
});
modelBuilder.Entity("SOR.Database.Entities.Catalog.CardAnimationBinding", b =>
{
b.HasOne("SOR.Database.Entities.Catalog.CardDefinition", "CardDefinition")
.WithMany("AnimationBindings")
.HasForeignKey("CardDefinitionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CardDefinition");
});
modelBuilder.Entity("SOR.Database.Entities.Catalog.CardAsset", b =>
{
b.HasOne("SOR.Database.Entities.Catalog.CardDefinition", "CardDefinition")
.WithMany("Assets")
.HasForeignKey("CardDefinitionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("CardDefinition");
});
modelBuilder.Entity("SOR.Database.Entities.Catalog.CardDefinition", b =>
{
b.HasOne("SOR.Database.Entities.Catalog.CardDefinition", "PreviousTier")
.WithMany()
.HasForeignKey("PreviousTierId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("SOR.Database.Entities.Catalog.CardSet", "Set")
.WithMany("Cards")
.HasForeignKey("SetId")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("PreviousTier");
b.Navigation("Set");
});
modelBuilder.Entity("SOR.Database.Entities.Catalog.CardDefinition", b =>
{
b.Navigation("AnimationBindings");
b.Navigation("Assets");
});
modelBuilder.Entity("SOR.Database.Entities.Catalog.CardSet", b =>
{
b.Navigation("Cards");
});
#pragma warning restore 612, 618
}
}
}
@@ -0,0 +1,53 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SOR.Database.Migrations.Catalog
{
/// <inheritdoc />
public partial class AddTileBottomModelShape : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_tile_bottom_models_IsActive",
schema: "catalog",
table: "tile_bottom_models");
migrationBuilder.AddColumn<string>(
name: "Shape",
schema: "catalog",
table: "tile_bottom_models",
type: "text",
nullable: false,
defaultValue: "Square");
migrationBuilder.CreateIndex(
name: "IX_tile_bottom_models_Shape_IsActive",
schema: "catalog",
table: "tile_bottom_models",
columns: new[] { "Shape", "IsActive" });
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "IX_tile_bottom_models_Shape_IsActive",
schema: "catalog",
table: "tile_bottom_models");
migrationBuilder.DropColumn(
name: "Shape",
schema: "catalog",
table: "tile_bottom_models");
migrationBuilder.CreateIndex(
name: "IX_tile_bottom_models_IsActive",
schema: "catalog",
table: "tile_bottom_models",
column: "IsActive");
}
}
}
@@ -499,12 +499,16 @@ namespace SOR.Database.Migrations.Catalog
.IsRequired()
.HasColumnType("text");
b.Property<string>("Shape")
.IsRequired()
.HasColumnType("text");
b.Property<DateTimeOffset>("UpdatedAt")
.HasColumnType("timestamp with time zone");
b.HasKey("Id");
b.HasIndex("IsActive");
b.HasIndex("Shape", "IsActive");
b.ToTable("tile_bottom_models", "catalog");
});