tests fixes and some product advisories tunes ups
This commit is contained in:
@@ -30,7 +30,12 @@ internal sealed partial class MigrationScript
|
||||
|
||||
public static bool TryCreate(string resourceName, string sql, [NotNullWhen(true)] out MigrationScript? script)
|
||||
{
|
||||
var fileName = resourceName.Split('.').Last();
|
||||
// Resource names are like: StellaOps.ExportCenter.Infrastructure.Db.Migrations.001_initial_schema.sql
|
||||
// We need to extract "001_initial_schema.sql" (last two segments joined)
|
||||
var parts = resourceName.Split('.');
|
||||
var fileName = parts.Length >= 2
|
||||
? $"{parts[^2]}.{parts[^1]}"
|
||||
: parts.LastOrDefault() ?? string.Empty;
|
||||
var match = VersionRegex.Match(fileName);
|
||||
|
||||
if (!match.Success || !int.TryParse(match.Groups["version"].Value, out var version))
|
||||
|
||||
Reference in New Issue
Block a user