Skip to content

Commit

Permalink
Fix Reset command. (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
chullybun committed Jul 22, 2022
1 parent 4368be6 commit 9a1796c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Represents the **NuGet** versions.

## v1.0.12
- *Fixed:* `Reset` command fixed to load embedded resource file correctly.

## v1.0.11
- *Enhancement:* Updated to `CoreEx.Database` version `1.0.7`.

Expand Down
19 changes: 1 addition & 18 deletions src/DbEx/DbEx.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<RootNamespace>DbEx</RootNamespace>
<Version>1.0.11</Version>
<Version>1.0.12</Version>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>DbEx Developers</Authors>
<Company>Avanade</Company>
Expand Down Expand Up @@ -38,23 +38,6 @@
<WarningsAsErrors />
</PropertyGroup>

<ItemGroup>
<None Remove="Resources\Alter_sql.hbs" />
<None Remove="Resources\CdcDb_sql.hbs" />
<None Remove="Resources\Cdc_sql.hbs" />
<None Remove="Resources\Create_sql.hbs" />
<None Remove="Resources\RefData_sql.hbs" />
<None Remove="Resources\Schema_sql.hbs" />
<None Remove="Templates\EventOutboxDequeue_cs.hbs" />
<None Remove="Templates\EventOutboxEnqueue_cs.hbs" />
<None Remove="Templates\SqlServer\SchemaEventOutbox_sql.hbs" />
<None Remove="Templates\SqlServer\SpEventOutboxDequeue_sql.hbs" />
<None Remove="Templates\SqlServer\SpEventOutboxEnqueue_sql.hbs" />
<None Remove="Templates\SqlServer\TableEventOutboxData_sql.hbs" />
<None Remove="Templates\SqlServer\TableEventOutbox_sql.hbs" />
<None Remove="Templates\SqlServer\UdtEventOutbox_sql.hbs" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Resources\Schema_sql.hbs" />
<EmbeddedResource Include="Resources\Alter_sql.hbs" />
Expand Down
4 changes: 2 additions & 2 deletions src/DbEx/Migration/SqlServer/SqlServerMigrator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ protected override async Task<bool> DatabaseSchemaAsync(List<DatabaseMigrationSc
/// <inheritdoc/>
protected override async Task<bool> DatabaseResetAsync()
{
Logger.LogInformation(" Deleting data from all tables (excludes schema 'dbo' and 'cdc').");
using var sr = StreamLocator.GetResourcesStreamReader("SqlServer.DeleteAllAndReset.sql", new Assembly[] { typeof(IDatabase).Assembly }).StreamReader!;
Logger.LogInformation(" Deleting data from all tables (excludes schema 'dbo' and 'cdc').");
using var sr = StreamLocator.GetResourcesStreamReader("SqlServer.DeleteAllAndReset.sql", new Assembly[] { typeof(DatabaseExtensions).Assembly }).StreamReader!;
var ss = new SqlScript($"{typeof(IDatabase).Namespace}.SqlServer.DeleteAllAndReset.sql", await sr.ReadToEndAsync().ConfigureAwait(false), new SqlScriptOptions { ScriptType = DbUp.Support.ScriptType.RunAlways });
return CheckDatabaseUpgradeResult(await ExecuteScriptsAsync(new SqlScript[] { ss }, false).ConfigureAwait(false));
}
Expand Down

0 comments on commit 9a1796c

Please sign in to comment.