lynMarkdigRenderTest85 1.0.0
dotnet add package lynMarkdigRenderTest85 --version 1.0.0
NuGet\Install-Package lynMarkdigRenderTest85 -Version 1.0.0
<PackageReference Include="lynMarkdigRenderTest85" Version="1.0.0" />
paket add lynMarkdigRenderTest85 --version 1.0.0
#r "nuget: lynMarkdigRenderTest85, 1.0.0"
// Install lynMarkdigRenderTest85 as a Cake Addin #addin nuget:?package=lynMarkdigRenderTest85&version=1.0.0 // Install lynMarkdigRenderTest85 as a Cake Tool #tool nuget:?package=lynMarkdigRenderTest85&version=1.0.0
EF migrator isn't idempotent in case of using Oracle DB. Consider you have a migration which consists of 2 operations:
- create table MY_TABLE1;
- create table MY_TABLE2.
If the migration falls after 1-st statement, then Oracle DB will become inconclusive: each DDL in Oracle commits the transaction, so DB will contain MY_TABLE1. The migration could neither be run once more (as Oracle will fall on the attemp to create MY_TABLE1), nor rolled back (EF "thinks" that migration is not installed and won't get it down).
Idempotent SQL Generator for Oracle generates code, that could be rerun in case of failure. For example, it generates such a code for creating MY_COLUMN in MY_TABLE:
DECLARE
i NUMBER;
BEGIN
SELECT COUNT(*) INTO i
FROM user_tab_columns
WHERE table_name = UPPER('MY_TABLE') AND column_name = UPPER('MY_COLUMN');
IF I != 1 THEN
EXECUTE IMMEDIATE 'ALTER TABLE MY_TABLE ADD (MY_COLUMN DATE)';
END IF;
END;
P.S. EF with MS SQL is idempotent out of the box. MS SQL has transactional DDL, which causes the migration to be fully installed or rolled back in case of error.
Usage
Just replace IMigrationsSqlGenerator when configuring DB Context:
public class MyDbContext : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.ReplaceService<IMigrationsSqlGenerator, IdempotentSqlGenerator>();
}
}
Running tests
- Open CMD at CUSTIS.OracleIdempotentSqlGenerator.Tests
- Run:
- dotnet user-secrets set DB ****
- dotnet user-secrets set Schema ****
- dotnet user-secrets set Pwd ****
- Tests will run at Schema@DB, which could be any schema (even empty)
Known issues
At time of 2020-02-17 OracleMigrationsSqlGenerator has no support of RestartSequenceOperation. It generates the code, that couldn't be run on OracleDB (ALTER SEQUENCE...RESTART WITH). As Idempotent SqlGenerator inherits from OracleMigrationsSqlGenerator, it has the same problem.
Publish
- Change version in CUSTIS.OracleIdempotentSqlGenerator
- Pack CUSTIS.OracleIdempotentSqlGenerator
- Upload it to nuget
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 0 | 11/24/2020 |