Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
903666f
Preserve SQLite dependencies and correct provider SQL handling
jogibear9988 Sep 22, 2026
d54ab5f
Fix reviewed provider default and constraint edge cases
jogibear9988 Sep 22, 2026
d84ba78
Limit Oracle default removal to in-place column changes
jogibear9988 Sep 22, 2026
669fb50
Preserve numeric precision and FK direction in definition overloads
jogibear9988 Sep 22, 2026
2f94516
Track SQL Server column uniqueness with persistent ownership metadata
jogibear9988 Sep 22, 2026
6881cae
Prefer native SQLite drop-column when dependencies allow it
jogibear9988 Sep 22, 2026
5ad9f03
Preserve SQLite autoincrement state during reconstruction
jogibear9988 Sep 22, 2026
6e14a47
Retain typed scalar results and order foreign key actions for SQL Server
jogibear9988 Sep 22, 2026
407c88e
Execute explicit SQL scripts with provider-specific batch handling
jogibear9988 Sep 22, 2026
8a359a9
Copy imperative column definitions before provider normalization
jogibear9988 Sep 22, 2026
dc6de68
Run nullable unique-column metadata regression across generic providers
jogibear9988 Sep 22, 2026
0bd0e09
Round-trip SQL Server TIME columns, defaults and values
jogibear9988 Sep 22, 2026
6e790d7
Require explicit ownership for Oracle legacy sequence cleanup
jogibear9988 Sep 22, 2026
b404da6
Fix uniqueness metadata and TimeSpan parameters exposed by live regre…
jogibear9988 Sep 22, 2026
29710ef
Verify nullable result contracts and non-mutating identifier quoting
jogibear9988 Sep 22, 2026
02a644b
Track SQL Server uniqueness ownership from creation and support expli…
jogibear9988 Sep 22, 2026
a5774a7
Quote provider constraint paths and retain legacy Oracle deletion act…
jogibear9988 Sep 22, 2026
28316a8
Preserve baseline line endings in touched provider and fixture files
jogibear9988 Sep 22, 2026
a09a74a
Resolve PostgreSQL metadata by relation and support native time round…
jogibear9988 Sep 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
168 changes: 84 additions & 84 deletions .github/workflows/dotnetpull.yml
Original file line number Diff line number Diff line change
@@ -1,84 +1,84 @@
name: .NET Pull Request
on:
push:
branches: [master]
pull_request:
branches: [master, "codex/**"]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: live-databases-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test (${{ matrix.database }})
runs-on: ubuntu-22.04
timeout-minutes: 35
strategy:
fail-fast: false
matrix:
database: [Unit, SQLite, SQLServer, PostgreSQL, Oracle, MySQL, MariaDB, Firebird, Db2, Informix, Sybase]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Start database
shell: bash
run: |
mkdir -p TestResults
bash .github/scripts/start-database.sh "${{ matrix.database }}" 2>&1 | tee TestResults/startup.log
timeout-minutes: 15
- name: Build
run: dotnet build Migrator.slnx -p:LiveDatabase=${{ matrix.database }}
- name: Configure native IBM drivers
if: matrix.database == 'Db2' || matrix.database == 'Informix'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y libaio1 libxml2 unixodbc libncurses5
output="$GITHUB_WORKSPACE/src/Migrator.Tests/bin/Debug/net9.0"
if [ "${{ matrix.database }}" = Db2 ]; then
echo "DB2_CLI_DRIVER_INSTALL_PATH=$output/clidriver" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=$output/clidriver/lib" >> "$GITHUB_ENV"
else
echo "DELIMIDENT=y" >> "$GITHUB_ENV"
echo "INFORMIXDIR=$output/native" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=$output/native/lib:$output/native/lib/cli:$output/native/lib/esql" >> "$GITHUB_ENV"
fi
- name: Test
shell: pwsh
run: ./.github/scripts/test.ps1 -Database ${{ matrix.database }}
- name: Collect database logs
if: always()
run: |
mkdir -p TestResults
if docker inspect migrator-db >/dev/null 2>&1; then
docker logs migrator-db > TestResults/database.log 2>&1
docker inspect migrator-db > TestResults/container.json
fi
- uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.database }}
path: TestResults/
if-no-files-found: error
- name: Remove test container
if: always()
run: |
if docker inspect migrator-db >/dev/null 2>&1; then
docker rm -fv migrator-db
fi
coverage:
name: Verify complete test coverage
needs: test
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: test-results-*
path: TestResults
- run: python3 .github/scripts/verify-test-coverage.py TestResults
name: .NET Pull Request
on:
push:
branches: [master]
pull_request:
branches: [master, "codex/**"]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: live-databases-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Test (${{ matrix.database }})
runs-on: ubuntu-22.04
timeout-minutes: 35
strategy:
fail-fast: false
matrix:
database: [Unit, SQLite, SQLServer, PostgreSQL, Oracle, MySQL, MariaDB, Firebird, Db2, Informix, Sybase]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Start database
shell: bash
run: |
mkdir -p TestResults
bash .github/scripts/start-database.sh "${{ matrix.database }}" 2>&1 | tee TestResults/startup.log
timeout-minutes: 15
- name: Build
run: dotnet build Migrator.slnx -p:LiveDatabase=${{ matrix.database }}
- name: Configure native IBM drivers
if: matrix.database == 'Db2' || matrix.database == 'Informix'
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y libaio1 libxml2 unixodbc libncurses5
output="$GITHUB_WORKSPACE/src/Migrator.Tests/bin/Debug/net9.0"
if [ "${{ matrix.database }}" = Db2 ]; then
echo "DB2_CLI_DRIVER_INSTALL_PATH=$output/clidriver" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=$output/clidriver/lib" >> "$GITHUB_ENV"
else
echo "DELIMIDENT=y" >> "$GITHUB_ENV"
echo "INFORMIXDIR=$output/native" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=$output/native/lib:$output/native/lib/cli:$output/native/lib/esql" >> "$GITHUB_ENV"
fi
- name: Test
shell: pwsh
run: ./.github/scripts/test.ps1 -Database ${{ matrix.database }}
- name: Collect database logs
if: always()
run: |
mkdir -p TestResults
if docker inspect migrator-db >/dev/null 2>&1; then
docker logs migrator-db > TestResults/database.log 2>&1
docker inspect migrator-db > TestResults/container.json
fi
- uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.database }}
path: TestResults/
if-no-files-found: error
- name: Remove test container
if: always()
run: |
if docker inspect migrator-db >/dev/null 2>&1; then
docker rm -fv migrator-db
fi
coverage:
name: Verify complete test coverage
needs: test
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
pattern: test-results-*
path: TestResults
- run: python3 .github/scripts/verify-test-coverage.py TestResults
138 changes: 69 additions & 69 deletions src/Migrator.Tests/MigrationLoaderTest.cs
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
using System.Reflection;
using DotNetProjects.Migrator;
using DotNetProjects.Migrator.Framework;
using DotNetProjects.Migrator.Framework.Loggers;
using NSubstitute;
using NUnit.Framework;

namespace Migrator.Tests;

[TestFixture]
public class MigrationLoaderTest
{
#region Setup/Teardown

[SetUp]
public void SetUp()
{
SetUpLoader();
}

#endregion

private MigrationLoader _migrationLoader;

private void SetUpLoader()
{
var providerMock = Substitute.For<ITransformationProvider>();

providerMock.Logger = new Logger(false);
_migrationLoader = new MigrationLoader(providerMock, Assembly.GetExecutingAssembly(), true);
_migrationLoader.MigrationsTypes.Clear();
_migrationLoader.MigrationsTypes.Add(typeof(MigratorTest.FirstMigration));
_migrationLoader.MigrationsTypes.Add(typeof(MigratorTest.SecondMigration));
_migrationLoader.MigrationsTypes.Add(typeof(MigratorTest.ThirdMigration));
_migrationLoader.MigrationsTypes.Add(typeof(MigratorTest.ForthMigration));
_migrationLoader.MigrationsTypes.Add(typeof(MigratorTest.BadMigration));
_migrationLoader.MigrationsTypes.Add(typeof(MigratorTest.SixthMigration));
_migrationLoader.MigrationsTypes.Add(typeof(MigratorTest.NonIgnoredMigration));
}

[Test]
public void CheckForDuplicatedVersion()
{
_migrationLoader.MigrationsTypes.Add(typeof(MigratorTest.FirstMigration));
Assert.Throws<DuplicatedVersionException>(() =>
{
_migrationLoader.CheckForDuplicatedVersion();
});
}

[Test]
public void LastVersion()
{
Assert.That(7, Is.EqualTo(_migrationLoader.LastVersion));
}

[Test]
public void NullIfNoMigrationForVersion()
{
Assert.That(_migrationLoader.GetMigration(99999999), Is.Null);
}

[Test]
public void ZeroIfNoMigrations()
{
_migrationLoader.MigrationsTypes.Clear();
Assert.That(0, Is.EqualTo(_migrationLoader.LastVersion));
}
}
using System.Reflection;
using DotNetProjects.Migrator;
using DotNetProjects.Migrator.Framework;
using DotNetProjects.Migrator.Framework.Loggers;
using NSubstitute;
using NUnit.Framework;
namespace Migrator.Tests;
[TestFixture]
public class MigrationLoaderTest
{
#region Setup/Teardown
[SetUp]
public void SetUp()
{
SetUpLoader();
}
#endregion
private MigrationLoader _migrationLoader;
private void SetUpLoader()
{
var providerMock = Substitute.For<ITransformationProvider>();
providerMock.Logger = new Logger(false);
_migrationLoader = new MigrationLoader(providerMock, Assembly.GetExecutingAssembly(), true);
_migrationLoader.MigrationsTypes.Clear();
_migrationLoader.MigrationsTypes.Add(typeof(MigratorTest.FirstMigration));
_migrationLoader.MigrationsTypes.Add(typeof(MigratorTest.SecondMigration));
_migrationLoader.MigrationsTypes.Add(typeof(MigratorTest.ThirdMigration));
_migrationLoader.MigrationsTypes.Add(typeof(MigratorTest.ForthMigration));
_migrationLoader.MigrationsTypes.Add(typeof(MigratorTest.BadMigration));
_migrationLoader.MigrationsTypes.Add(typeof(MigratorTest.SixthMigration));
_migrationLoader.MigrationsTypes.Add(typeof(MigratorTest.NonIgnoredMigration));
}
[Test]
public void CheckForDuplicatedVersion()
{
_migrationLoader.MigrationsTypes.Add(typeof(MigratorTest.FirstMigration));
Assert.Throws<DuplicatedVersionException>(() =>
{
_migrationLoader.CheckForDuplicatedVersion();
});
}
[Test]
public void LastVersion()
{
Assert.That(7, Is.EqualTo(_migrationLoader.LastVersion));
}
[Test]
public void NullIfNoMigrationForVersion()
{
Assert.That(_migrationLoader.GetMigration(99999999), Is.Null);
}
[Test]
public void ZeroIfNoMigrations()
{
_migrationLoader.MigrationsTypes.Clear();
Assert.That(0, Is.EqualTo(_migrationLoader.LastVersion));
}
}
29 changes: 15 additions & 14 deletions src/Migrator.Tests/Migrator.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="10.3.4" />
<ItemGroup>
<PackageReference Include="FirebirdSql.Data.FirebirdClient" Version="10.3.4" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="6.1.0" />
<PackageReference Include="MySql.Data" Version="9.4.0" />
<PackageReference Include="NSubstitute" Version="5.3.0" />
Expand All @@ -31,25 +31,26 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition="'$(LiveDatabase)' == 'Db2'">
<PackageReference Include="Net.IBM.Data.Db2-lnx" Version="9.0.0.400" />
</ItemGroup>
<ItemGroup Condition="'$(LiveDatabase)' == 'Informix'">
<PackageReference Include="Informix.Net.Core-lnx" Version="4.1501.2.2026" />
</ItemGroup>
<ItemGroup Condition="'$(LiveDatabase)' == 'Sybase'">
<PackageReference Include="AdoNetCore.AseClient" Version="0.19.2" />
</ItemGroup>
</ItemGroup>
<ItemGroup Condition="'$(LiveDatabase)' == 'Db2'">
<PackageReference Include="Net.IBM.Data.Db2-lnx" Version="9.0.0.400" />
</ItemGroup>
<ItemGroup Condition="'$(LiveDatabase)' == 'Informix'">
<PackageReference Include="Informix.Net.Core-lnx" Version="4.1501.2.2026" />
</ItemGroup>
<ItemGroup Condition="'$(LiveDatabase)' == 'Sybase'">
<PackageReference Include="AdoNetCore.AseClient" Version="0.19.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Migrator\DotNetProjects.Migrator.csproj" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="ScriptResource.sql" LogicalName="Migrator.Tests.ScriptResource.sql" />
<None Update="appsettings.json" CopyToOutputDirectory="PreserveNewest" />
<None Update="appsettings.Development.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

</Project>
</Project>
Loading
Loading