using MongoDB.Driver;

namespace StellaOps.Feedser.Storage.Mongo.Migrations;

/// <summary>
/// Represents a single, idempotent MongoDB migration.
/// </summary>
public interface IMongoMigration
{
    /// <summary>
    /// Unique identifier for the migration. Sorting is performed using ordinal comparison.
    /// </summary>
    string Id { get; }

    /// <summary>
    /// Short description surfaced in logs to aid runbooks.
    /// </summary>
    string Description { get; }

    /// <summary>
    /// Executes the migration.
    /// </summary>
    Task ApplyAsync(IMongoDatabase database, CancellationToken cancellationToken);
}
