Something went wrong. Try again.
A database migration tool for .NET
Something went wrong. Try again.
1.2 kB · 42 lines
C#
at develop
12345678910111213141516171819202122232425262728293031323334353637383940414243namespace Migrato.Core;
/// <summary>/// Migration represents a SQL migration/// </summary>/// <remarks>/// Creates a new instance of Migration/// </remarks>/// <param name="version"></param>public class Migration(long version){
/// <summary> /// Gets the version of the migration /// </summary> public long Version { get; init; } = version;
/// <summary> /// Gets the file path of the migration /// </summary> public string? Source { get; init; }
/// <summary> /// Gets the name of the migration, derived from its file name /// </summary> public string Name { get; init; } = string.Empty;
/// <summary> /// Gets the SQL that should run when applying this migration /// </summary> public string UpSql { get; init; } = string.Empty;
/// <summary> /// Gets the SQL that should run when reverting this migration /// </summary> public string DownSql { get; init; } = string.Empty;
/// <summary> /// Returns the migration's <see cref="Source"/> path /// </summary> public override string ToString() => Source ?? "";}