Files
marechai/Marechai.Database/Models/SoftwareExternalId.cs
Natalia Portillo 072b56402c feat: Add first-class Software external IDs (MobyGames, IGDB, ...)
Adds a generic ExternalSite + SoftwareExternalId table pair so a Software
can carry identifiers for external cataloging websites, independent from
the existing MobyGames/IGDB mirror/match tables. Backfills existing
matched MobyGames and IGDB rows, and wires new imports/matches to keep
the new table in sync going forward (MobyGames numeric id preferred,
falling back to slug; IGDB slug preferred, falling back to numeric id,
with a new backfill-game-slugs command for previously mirrored rows).
2026-06-26 12:42:06 +01:00

52 lines
2.2 KiB
C#

/******************************************************************************
// MARECHAI: Master repository of computing history artifacts information
// ----------------------------------------------------------------------------
//
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2003-2026 Natalia Portillo
*******************************************************************************/
using System.ComponentModel.DataAnnotations;
namespace Marechai.Database.Models;
/// <summary>
/// The identifier a <see cref="Software" /> entry has on a given <see cref="ExternalSite" />
/// (e.g. its MobyGames slug or IGDB numeric ID). The pair (<see cref="ExternalSiteId" />,
/// <see cref="ExternalId" />) is unique, preventing the same external identifier from being
/// registered twice for the same site. This is a first-class, general-purpose record kept
/// alongside (not instead of) the site-specific mirror/match tables such as
/// <see cref="MobyGamesImportState" /> and <see cref="IgdbGame" />.
/// </summary>
public class SoftwareExternalId : BaseModel<long>
{
public ulong SoftwareId { get; set; }
public virtual Software Software { get; set; }
public long ExternalSiteId { get; set; }
public virtual ExternalSite ExternalSite { get; set; }
[Required]
[StringLength(255)]
public string ExternalId { get; set; }
}