generated from Avanade/avanade-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor to improve database agnostic and re-include DbUp. * Rename scripts resource to have explicit Script prefix. * Parameterize the Journal Schema and Table. Improve extendibility of capabilities. * Improved internals, and readying support for mulitple dbs. * Move SQL Server capabilities to separate project/assembly.
- Loading branch information
Showing
77 changed files
with
1,704 additions
and
1,374 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<Version>1.1.1</Version> | ||
<LangVersion>preview</LangVersion> | ||
<Authors>Avanade</Authors> | ||
<Company>Avanade</Company> | ||
<Copyright>Avanade (c)</Copyright> | ||
<PackageProjectUrl>https://github.com/Avanade/DbEx</PackageProjectUrl> | ||
<RepositoryUrl>https://github.com/Avanade/DbEx</RepositoryUrl> | ||
<SignAssembly>true</SignAssembly> | ||
<DelaySign>false</DelaySign> | ||
<AssemblyOriginatorKeyFile>strong-name-key.snk</AssemblyOriginatorKeyFile> | ||
<RepositoryType>git</RepositoryType> | ||
<GeneratePackageOnBuild>false</GeneratePackageOnBuild> | ||
<PackageIconUrl>https://github.com/Avanade/DbEx/raw/main/images/Logo256x256.png</PackageIconUrl> | ||
<PackageIcon>Logo256x256.png</PackageIcon> | ||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder> | ||
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild> | ||
<Nullable>enable</Nullable> | ||
<EnableNETAnalyzers>true</EnableNETAnalyzers> | ||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | ||
<SymbolPackageFormat>snupkg</SymbolPackageFormat> | ||
<IncludeSymbols>true</IncludeSymbols> | ||
<EmbedAllSources>true</EmbedAllSources> | ||
<IsPackable>true</IsPackable> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<None Include="..\..\images\Logo256x256.png" Link="Logo256x256.png"> | ||
<PackagePath>\</PackagePath> | ||
<Pack>true</Pack> | ||
</None> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright (c) Avanade. Licensed under the MIT License. See https://github.com/Avanade/DbEx | ||
|
||
using DbEx.Console; | ||
using DbEx.Migration; | ||
using DbEx.SqlServer.Migration; | ||
using System; | ||
using System.Reflection; | ||
|
||
namespace DbEx.SqlServer.Console | ||
{ | ||
/// <summary> | ||
/// Console that facilitates the <see cref="SqlServerMigration"/> by managing the standard console command-line arguments/options. | ||
/// </summary> | ||
public sealed class SqlServerMigrationConsole : MigrationConsoleBase<SqlServerMigrationConsole> | ||
{ | ||
/// <summary> | ||
/// Creates a new <see cref="SqlServerMigrationConsole"/> using <typeparamref name="T"/> to default the probing <see cref="Assembly"/>. | ||
/// </summary> | ||
/// <typeparam name="T">The <see cref="Type"/>.</typeparam> | ||
/// <param name="connectionString">The database connection string.</param> | ||
/// <returns>A new <see cref="SqlServerMigrationConsole"/>.</returns> | ||
public static SqlServerMigrationConsole Create<T>(string connectionString) => new(new MigrationArgs { ConnectionString = connectionString }.AddAssembly(typeof(T).Assembly)); | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="SqlServerMigrationConsole"/> class. | ||
/// </summary> | ||
/// <param name="args">The default <see cref="MigrationArgs"/> that will be overridden/updated by the command-line argument values.</param> | ||
public SqlServerMigrationConsole(MigrationArgs? args = null) : base(args ?? new MigrationArgs()) { } | ||
|
||
/// <summary> | ||
/// Initializes a new instance of the <see cref="SqlServerMigrationConsole"/> class that provides a default for the <paramref name="connectionString"/>. | ||
/// </summary> | ||
/// <param name="connectionString">The database connection string.</param> | ||
public SqlServerMigrationConsole(string connectionString) : base(new MigrationArgs { ConnectionString = connectionString ?? throw new ArgumentNullException(nameof(connectionString)) }) { } | ||
|
||
/// <summary> | ||
/// Gets the <see cref="MigrationArgs"/>. | ||
/// </summary> | ||
public new MigrationArgs Args => (MigrationArgs)base.Args; | ||
|
||
/// <inheritdoc/> | ||
protected override DatabaseMigrationBase CreateMigrator() => new SqlServerMigration(Args); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netstandard2.1</TargetFramework> | ||
<RootNamespace>DbEx.SqlServer</RootNamespace> | ||
<Product>DbEx</Product> | ||
<Title>DbEx Database Migration Tool.</Title> | ||
<Description>DbEX Database Migration tool for SQL Server.</Description> | ||
<PackageTags>dbex database dbup db-up sqlserver sql</PackageTags> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<WarningsAsErrors /> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<EmbeddedResource Include="Resources\**\*" /> | ||
<EmbeddedResource Include="Migrations\**\*" /> | ||
<EmbeddedResource Include="Data\**\*" /> | ||
<EmbeddedResource Include="Templates\**\*" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="Resources\DatabaseCreate.sql" /> | ||
<None Remove="Resources\DatabaseData_sql.hbs" /> | ||
<None Remove="Resources\DatabaseDrop.sql" /> | ||
<None Remove="Resources\DatabaseReset_sql.hbs" /> | ||
<None Remove="Resources\DatabaseTemporal.sql" /> | ||
<None Remove="Resources\JournalAudit.sql" /> | ||
<None Remove="Resources\JournalCreate.sql" /> | ||
<None Remove="Resources\JournalExists.sql" /> | ||
<None Remove="Resources\JournalPrevious.sql" /> | ||
<None Remove="Resources\ScriptAlter_sql.hbs" /> | ||
<None Remove="Resources\ScriptCdcDb_sql.hbs" /> | ||
<None Remove="Resources\ScriptCdc_sql.hbs" /> | ||
<None Remove="Resources\ScriptCreate_sql.hbs" /> | ||
<None Remove="Resources\ScriptDefault_sql.hbs" /> | ||
<None Remove="Resources\ScriptRefData_sql.hbs" /> | ||
<None Remove="Resources\ScriptSchema_sql.hbs" /> | ||
<None Remove="Templates\EventOutboxDequeue_cs.hbs" /> | ||
<None Remove="Templates\EventOutboxEnqueue_cs.hbs" /> | ||
<None Remove="Templates\SchemaEventOutbox_sql.hbs" /> | ||
<None Remove="Templates\SpEventOutboxDequeue_sql.hbs" /> | ||
<None Remove="Templates\SpEventOutboxEnqueue_sql.hbs" /> | ||
<None Remove="Templates\TableEventOutboxData_sql.hbs" /> | ||
<None Remove="Templates\TableEventOutbox_sql.hbs" /> | ||
<None Remove="Templates\UdtEventOutbox_sql.hbs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="CoreEx.Database.SqlServer" Version="1.0.12" /> | ||
<PackageReference Include="dbup-sqlserver" Version="4.6.0" /> | ||
<PackageReference Include="OnRamp" Version="1.0.6" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\DbEx\DbEx.csproj" /> | ||
</ItemGroup> | ||
|
||
<Import Project="..\..\Common.targets" /> | ||
|
||
</Project> |
Oops, something went wrong.