Feature: tile spacing gap + 2D placeholder textures
Visual changes (client): - 0.1 gap between all tiles (TILE_SPACING = 1.1) - Placeholder tiles (no 3D model) are now 0.5 height instead of random 0.8-1.0, making undecorated tiles visually distinct - Placeholder tiles load a 2D CDN texture via HTTP and apply it as the albedo on the BoxMesh (same affinity-per-shape lookup as 3D models) - Placeholder tiles also attach a stalagmite bottom model, matching the look of fully-decorated tiles Server: - TileModelBinding.TexturePublicUrl (nullable text) added to entity, migration 20260317000001_AddTileTexture applied to DB - TileModelDto extended with TexturePublicUrl - ContentGetTileModelsHandler includes TexturePublicUrl in response Admin (/content/tile-models): - New "Square Texture" and "Hex Texture" columns in the bindings table - Texture picker modal browses the CDN textures/ prefix and shows image thumbnails; select + assign writes TexturePublicUrl to the binding - Texture can be assigned without a 3D model (creates a binding row with empty model fields) ContentCache: - Caches texturePublicUrl alongside modelPublicUrl from tile_models response - New get_tile_texture_url(affinity, shape) → String accessor 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:
@@ -49,7 +49,9 @@ else
|
||||
<tr>
|
||||
<th style="width:160px">Affinity</th>
|
||||
<th>Square Model</th>
|
||||
<th>Square Texture</th>
|
||||
<th>Hex Model</th>
|
||||
<th>Hex Texture</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -63,9 +65,15 @@ else
|
||||
<td class="align-middle">
|
||||
@ModelCell(squareBinding, affinity, TileShape.Square)
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
@TextureCell(squareBinding, affinity, TileShape.Square)
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
@ModelCell(hexBinding, affinity, TileShape.Hex)
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
@TextureCell(hexBinding, affinity, TileShape.Hex)
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
@@ -308,6 +316,75 @@ else
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- Texture Picker Modal -->
|
||||
@if (_texPickerOpen)
|
||||
{
|
||||
<div class="modal d-block" tabindex="-1" style="background:rgba(0,0,0,0.55)">
|
||||
<div class="modal-dialog modal-xl modal-dialog-scrollable">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">
|
||||
Assign Texture — <span class="text-primary">@_texPickerAffinity</span>
|
||||
<span class="badge bg-secondary ms-2">@_texPickerShape</span>
|
||||
</h5>
|
||||
<button type="button" class="btn-close" @onclick="CloseTexPicker"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<input @bind="_texPickerSearch" @bind:event="oninput"
|
||||
class="form-control form-control-sm font-monospace mb-3"
|
||||
placeholder="Filter textures…" />
|
||||
@if (_texPickerLoading)
|
||||
{
|
||||
<div class="text-muted text-center py-4">
|
||||
<span class="spinner-border spinner-border-sm me-2"></span>Loading CDN textures…
|
||||
</div>
|
||||
}
|
||||
else if (!_texPickerItems.Any())
|
||||
{
|
||||
<div class="text-muted text-center py-4">
|
||||
No image files found in the <code>textures/</code> prefix.
|
||||
Upload textures via the CDN Browser first.
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="row g-3">
|
||||
@foreach (var tex in TexPickerFiltered())
|
||||
{
|
||||
var t = tex;
|
||||
var isSel = _texPickerSelected == t.PublicUrl;
|
||||
<div class="col-md-3">
|
||||
<div class="card h-100 @(isSel ? "border-primary" : "")"
|
||||
style="cursor:pointer" @onclick="() => _texPickerSelected = t.PublicUrl">
|
||||
<img src="@t.PublicUrl" alt="@t.ShortName"
|
||||
style="height:120px;object-fit:cover;border-radius:4px 4px 0 0" />
|
||||
<div class="card-body py-1 px-2">
|
||||
<div class="font-monospace small text-break">@t.ShortName</div>
|
||||
</div>
|
||||
@if (isSel)
|
||||
{
|
||||
<div class="card-footer py-1 bg-primary text-white text-center small">✓ Selected</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-secondary" @onclick="CloseTexPicker">Cancel</button>
|
||||
<button class="btn btn-primary"
|
||||
disabled="@(_texPickerSelected is null || _saving)"
|
||||
@onclick="SaveTextureAsync">
|
||||
@if (_saving) { <span class="spinner-border spinner-border-sm me-1"></span> }
|
||||
Assign Selected
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<script type="module" src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.5.0/model-viewer.min.js"></script>
|
||||
|
||||
@code {
|
||||
@@ -346,6 +423,15 @@ else
|
||||
("Gateways", new[] { Affinity.GatewayLake, Affinity.GatewayHill, Affinity.GatewayForest, Affinity.GatewayField }),
|
||||
};
|
||||
|
||||
// Texture picker state
|
||||
private bool _texPickerOpen;
|
||||
private bool _texPickerLoading;
|
||||
private Affinity _texPickerAffinity;
|
||||
private TileShape _texPickerShape;
|
||||
private string _texPickerSearch = "";
|
||||
private string? _texPickerSelected;
|
||||
private List<TexItem> _texPickerItems = new();
|
||||
|
||||
// Tile bottom models
|
||||
private List<TileBottomModel> _bottomModels = new();
|
||||
private bool _bottomPickerOpen;
|
||||
@@ -495,6 +581,145 @@ else
|
||||
_isError = false;
|
||||
}
|
||||
|
||||
// ── Texture Picker ────────────────────────────────────────────────────────
|
||||
|
||||
private async Task OpenTexPickerAsync(Affinity affinity, TileShape shape)
|
||||
{
|
||||
_texPickerAffinity = affinity;
|
||||
_texPickerShape = shape;
|
||||
_texPickerSelected = _bindings.TryGetValue((affinity, shape), out var b) ? b.TexturePublicUrl : null;
|
||||
_texPickerSearch = "";
|
||||
_texPickerOpen = true;
|
||||
_texPickerLoading = true;
|
||||
await LoadTexPickerItemsAsync();
|
||||
}
|
||||
|
||||
private async Task LoadTexPickerItemsAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
var options = CdnOptionsAccessor.Value;
|
||||
var request = new ListObjectsV2Request
|
||||
{
|
||||
BucketName = options.BucketName,
|
||||
Prefix = "textures/",
|
||||
MaxKeys = 1000,
|
||||
};
|
||||
var response = await S3.ListObjectsV2Async(request);
|
||||
_texPickerItems = response.S3Objects
|
||||
.Where(o => !o.Key.EndsWith('/') && IsImageKey(o.Key))
|
||||
.Select(o => new TexItem
|
||||
{
|
||||
Key = o.Key,
|
||||
ShortName = o.Key.Contains('/') ? o.Key[(o.Key.LastIndexOf('/') + 1)..] : o.Key,
|
||||
PublicUrl = BuildPublicUrl(options, o.Key),
|
||||
})
|
||||
.OrderBy(t => t.Key)
|
||||
.ToList();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_message = $"Failed to load CDN textures: {ex.Message}";
|
||||
_isError = true;
|
||||
}
|
||||
finally { _texPickerLoading = false; }
|
||||
}
|
||||
|
||||
private IEnumerable<TexItem> TexPickerFiltered() =>
|
||||
string.IsNullOrWhiteSpace(_texPickerSearch)
|
||||
? _texPickerItems
|
||||
: _texPickerItems.Where(t => t.Key.Contains(_texPickerSearch, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
private void CloseTexPicker()
|
||||
{
|
||||
_texPickerOpen = false;
|
||||
_texPickerItems = new();
|
||||
_texPickerSelected = null;
|
||||
}
|
||||
|
||||
private async Task SaveTextureAsync()
|
||||
{
|
||||
if (_texPickerSelected is null) return;
|
||||
_saving = true;
|
||||
try
|
||||
{
|
||||
var binding = await Db.TileModelBindings
|
||||
.FirstOrDefaultAsync(b => b.Affinity == _texPickerAffinity && b.Shape == _texPickerShape);
|
||||
|
||||
if (binding is null)
|
||||
{
|
||||
// Create a texture-only binding (no 3D model yet).
|
||||
binding = new TileModelBinding
|
||||
{
|
||||
Affinity = _texPickerAffinity,
|
||||
Shape = _texPickerShape,
|
||||
ModelCdnKey = "",
|
||||
ModelPublicUrl = "",
|
||||
};
|
||||
Db.TileModelBindings.Add(binding);
|
||||
}
|
||||
|
||||
binding.TexturePublicUrl = _texPickerSelected;
|
||||
binding.UpdatedAt = DateTimeOffset.UtcNow;
|
||||
await Db.SaveChangesAsync();
|
||||
|
||||
_bindings[(_texPickerAffinity, _texPickerShape)] = binding;
|
||||
_message = $"Texture assigned to {_texPickerAffinity} / {_texPickerShape}.";
|
||||
_isError = false;
|
||||
CloseTexPicker();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_message = $"Save failed: {ex.Message}";
|
||||
_isError = true;
|
||||
}
|
||||
finally { _saving = false; }
|
||||
}
|
||||
|
||||
private async Task ClearTextureAsync(Affinity affinity, TileShape shape)
|
||||
{
|
||||
var binding = await Db.TileModelBindings
|
||||
.FirstOrDefaultAsync(b => b.Affinity == affinity && b.Shape == shape);
|
||||
if (binding is null) return;
|
||||
|
||||
binding.TexturePublicUrl = null;
|
||||
binding.UpdatedAt = DateTimeOffset.UtcNow;
|
||||
await Db.SaveChangesAsync();
|
||||
_bindings[(affinity, shape)] = binding;
|
||||
_message = $"Texture cleared for {affinity} / {shape}.";
|
||||
_isError = false;
|
||||
}
|
||||
|
||||
private RenderFragment TextureCell(TileModelBinding? binding, Affinity affinity, TileShape shape) => __builder =>
|
||||
{
|
||||
var url = binding?.TexturePublicUrl;
|
||||
if (url is not null)
|
||||
{
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<img src="@url" alt="texture" style="height:40px;width:40px;object-fit:cover;border-radius:4px" />
|
||||
<button class="btn btn-sm btn-outline-warning py-0"
|
||||
@onclick="() => OpenTexPickerAsync(affinity, shape)"
|
||||
title="Change texture"><i class="bi bi-arrow-repeat"></i></button>
|
||||
<button class="btn btn-sm btn-outline-danger py-0"
|
||||
@onclick="() => ClearTextureAsync(affinity, shape)"
|
||||
title="Remove texture"><i class="bi bi-x"></i></button>
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="btn btn-sm btn-outline-secondary"
|
||||
@onclick="() => OpenTexPickerAsync(affinity, shape)">
|
||||
<i class="bi bi-image me-1"></i>Assign
|
||||
</button>
|
||||
}
|
||||
};
|
||||
|
||||
private static bool IsImageKey(string key) =>
|
||||
key.EndsWith(".jpg", StringComparison.OrdinalIgnoreCase) ||
|
||||
key.EndsWith(".jpeg", StringComparison.OrdinalIgnoreCase) ||
|
||||
key.EndsWith(".png", StringComparison.OrdinalIgnoreCase) ||
|
||||
key.EndsWith(".webp", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
// ── Tile Bottom Models ────────────────────────────────────────────────────
|
||||
|
||||
private async Task OpenBottomPickerAsync()
|
||||
@@ -608,4 +833,11 @@ else
|
||||
public string ShortName { get; init; } = "";
|
||||
public string PublicUrl { get; init; } = "";
|
||||
}
|
||||
|
||||
private sealed class TexItem
|
||||
{
|
||||
public string Key { get; init; } = "";
|
||||
public string ShortName { get; init; } = "";
|
||||
public string PublicUrl { get; init; } = "";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,9 +38,10 @@ public sealed record GetTileModelsResponse(IEnumerable<TileModelDto> Bindings);
|
||||
public sealed record GetTileBottomsResponse(IEnumerable<string> Urls);
|
||||
|
||||
public sealed record TileModelDto(
|
||||
string Affinity,
|
||||
string Shape,
|
||||
string ModelPublicUrl);
|
||||
string Affinity,
|
||||
string Shape,
|
||||
string ModelPublicUrl,
|
||||
string? TexturePublicUrl);
|
||||
|
||||
// ── DTOs ──────────────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
@@ -33,7 +33,8 @@ internal sealed class ContentGetTileModelsHandler : IMessageHandler
|
||||
.Select(b => new TileModelDto(
|
||||
b.Affinity.ToString(),
|
||||
b.Shape.ToString(),
|
||||
b.ModelPublicUrl))
|
||||
b.ModelPublicUrl,
|
||||
b.TexturePublicUrl))
|
||||
.ToListAsync(ct);
|
||||
|
||||
return ServerMessage.Reply("content.tile_models.ack", message.Seq,
|
||||
|
||||
@@ -22,5 +22,11 @@ public sealed class TileModelBinding
|
||||
/// <summary>Publicly accessible CDN URL for the model file.</summary>
|
||||
public string ModelPublicUrl { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Optional CDN URL for a 2D texture applied to the placeholder tile mesh
|
||||
/// (shown when no 3D model is assigned for this affinity).
|
||||
/// </summary>
|
||||
public string? TexturePublicUrl { get; set; }
|
||||
|
||||
public DateTimeOffset UpdatedAt { get; set; }
|
||||
}
|
||||
|
||||
+487
@@ -0,0 +1,487 @@
|
||||
// <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("20260317000001_AddTileTexture")]
|
||||
partial class AddTileTexture
|
||||
{
|
||||
/// <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<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>("AttackType")
|
||||
.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<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<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.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<DateTimeOffset>("UpdatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("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,30 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace SOR.Database.Migrations.Catalog
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class AddTileTexture : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "TexturePublicUrl",
|
||||
schema: "catalog",
|
||||
table: "tile_model_bindings",
|
||||
type: "text",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TexturePublicUrl",
|
||||
schema: "catalog",
|
||||
table: "tile_model_bindings");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -387,6 +387,9 @@ namespace SOR.Database.Migrations.Catalog
|
||||
.IsRequired()
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("TexturePublicUrl")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<DateTimeOffset>("UpdatedAt")
|
||||
.HasColumnType("timestamp with time zone");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user