This repository has been archived by the owner on Jul 25, 2024. It is now read-only.
generated from DbUp/dbup-provider-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
221 additions
and
217 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
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 |
---|---|---|
@@ -1,27 +1,27 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project> | ||
|
||
<PropertyGroup> | ||
<Authors>https://github.com/orgs/DbUp/people</Authors> | ||
<PackageReleaseNotes>https://github.com/DbUp/dbup-sqlce/releases</PackageReleaseNotes> | ||
<PackageProjectUrl>https://dbup.github.io</PackageProjectUrl> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
<RepositoryUrl>https://github.com/dbup-sqlce/dbup-sqlce.git</RepositoryUrl> | ||
<LangVersion>latest</LangVersion> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<Authors>https://github.com/orgs/DbUp/people</Authors> | ||
<PackageReleaseNotes>https://github.com/DbUp/dbup-sqlce/releases</PackageReleaseNotes> | ||
<PackageProjectUrl>https://dbup.github.io</PackageProjectUrl> | ||
<PackageLicenseExpression>MIT</PackageLicenseExpression> | ||
<RepositoryUrl>https://github.com/dbup-sqlce/dbup-sqlce.git</RepositoryUrl> | ||
<LangVersion>latest</LangVersion> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(TF_BUILD)' == 'true' Or '$(CI)' == 'true'"> | ||
<PropertyGroup Condition="'$(TF_BUILD)' == 'true' Or '$(CI)' == 'true'"> | ||
|
||
<!-- Perform a deterministic build, so our binaries aren't impacted by build server environmental factors (e.g. file paths). --> | ||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild> | ||
<!-- Perform a deterministic build, so our binaries aren't impacted by build server environmental factors (e.g. file paths). --> | ||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild> | ||
|
||
<!-- Embed source files that are not tracked by the source control manager in the PDB --> | ||
<EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
<!-- Embed source files that are not tracked by the source control manager in the PDB --> | ||
<EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
|
||
<!-- Recommended: Embed symbols containing Source Link in the main file (exe/dll) --> | ||
<DebugType>embedded</DebugType> | ||
<!-- Recommended: Embed symbols containing Source Link in the main file (exe/dll) --> | ||
<DebugType>embedded</DebugType> | ||
|
||
</PropertyGroup> | ||
</PropertyGroup> | ||
|
||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,33 @@ | ||
#if !NETCORE | ||
using System; | ||
using System.Data.SqlServerCe; | ||
using System.IO; | ||
using Shouldly; | ||
using Xunit; | ||
|
||
namespace DbUp.Tests.Support.SqlCe | ||
namespace DbUp.SqlCe.Tests; | ||
|
||
public class SqlCeSupportTests | ||
{ | ||
public class SqlCeSupportTests | ||
[Fact] | ||
public void CanUseSqlCe4() | ||
{ | ||
[Fact] | ||
public void CanUseSqlCe4() | ||
{ | ||
const string connectionString = "Data Source=test.sdf; Persist Security Info=False"; | ||
const string connectionString = "Data Source=test.sdf; Persist Security Info=False"; | ||
|
||
if (!File.Exists("test.sdf")) | ||
{ | ||
var engine = new SqlCeEngine(connectionString); | ||
engine.CreateDatabase(); | ||
} | ||
if (!File.Exists("test.sdf")) | ||
{ | ||
var engine = new SqlCeEngine(connectionString); | ||
engine.CreateDatabase(); | ||
Check failure on line 19 in src/Tests/SqlCeSupportTests.cs GitHub Actions / TestsDbUp.SqlCe.Tests.SqlCeSupportTests ► CanUseSqlCe4
Raw output
|
||
} | ||
|
||
//Verify supports scripts which specify schema (To Support SqlCe and Sql with Schemas) | ||
var upgrader = DeployChanges.To | ||
.SqlCeDatabase(connectionString) | ||
.WithScript("Script0001", "create table $schema$.Foo (Id int)") | ||
.Build(); | ||
//Verify supports scripts which specify schema (To Support SqlCe and Sql with Schemas) | ||
var upgrader = DeployChanges.To | ||
.SqlCeDatabase(connectionString) | ||
.WithScript("Script0001", "create table $schema$.Foo (Id int)") | ||
.Build(); | ||
|
||
var result = upgrader.PerformUpgrade(); | ||
var result = upgrader.PerformUpgrade(); | ||
|
||
result.Successful.ShouldBe(true); | ||
} | ||
result.Successful.ShouldBe(true); | ||
} | ||
} | ||
#endif |
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 |
---|---|---|
@@ -1,30 +1,30 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net462</TargetFrameworks> | ||
<AssemblyName>Tests</AssemblyName> | ||
<RootNamespace>DbUp.SqlCe.Tests</RootNamespace> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<!-- <ImplicitUsings>enable</ImplicitUsings> Can't use implict usings with net46 --> | ||
<Nullable>enable</Nullable> | ||
<NoWarn>$(NoWarn);NETSDK1138</NoWarn> <!-- Purposefully leaving an old version of netcoreapp to ensure we have compatibility. This never gets published --> | ||
<LangVersion>latest</LangVersion> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<TargetFrameworks>net462</TargetFrameworks> | ||
<AssemblyName>Tests</AssemblyName> | ||
<RootNamespace>DbUp.SqlCe.Tests</RootNamespace> | ||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors> | ||
<!-- <ImplicitUsings>enable</ImplicitUsings> Can't use implict usings with net46 --> | ||
<Nullable>enable</Nullable> | ||
<NoWarn>$(NoWarn);NETSDK1138</NoWarn> <!-- Purposefully leaving an old version of netcoreapp to ensure we have compatibility. This never gets published --> | ||
<LangVersion>latest</LangVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\dbup-sqlce\dbup-sqlce.csproj" /> | ||
<PackageReference Include="DbUp.Tests.Common" Version="5.0.37" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" /> | ||
<PackageReference Include="xunit" Version="2.6.6" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\dbup-sqlce\dbup-sqlce.csproj"/> | ||
<PackageReference Include="DbUp.Tests.Common" Version="5.0.37"/> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0"/> | ||
<PackageReference Include="xunit" Version="2.6.6"/> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.6"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Remove="ApprovalFiles\*.cs"/> | ||
<None Include="ApprovalFiles\*.cs"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Remove="ApprovalFiles\*.cs" /> | ||
<None Include="ApprovalFiles\*.cs" /> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ClassWithVirtualMembersNeverInherited_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String> | ||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/DEFAULT_INTERNAL_MODIFIER/@EntryValue">Implicit</s:String> | ||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/DEFAULT_PRIVATE_MODIFIER/@EntryValue">Implicit</s:String> | ||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SQ/@EntryIndexedValue">SQ</s:String> | ||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String> | ||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String> | ||
<s:String x:Key="/Default/FilterSettingsManager/CoverageFilterXml/@EntryValue"><data><IncludeFilters /><ExcludeFilters /></data></s:String> | ||
<s:String x:Key="/Default/FilterSettingsManager/AttributeFilterXml/@EntryValue"><data /></s:String></wpf:ResourceDictionary> | ||
<wpf:ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" | ||
xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xml:space="preserve"> | ||
<s:String | ||
x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ClassWithVirtualMembersNeverInherited_002EGlobal/@EntryIndexedValue">DO_NOT_SHOW</s:String> | ||
<s:String | ||
x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/DEFAULT_INTERNAL_MODIFIER/@EntryValue">Implicit</s:String> | ||
<s:String | ||
x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/DEFAULT_PRIVATE_MODIFIER/@EntryValue">Implicit</s:String> | ||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SQ/@EntryIndexedValue">SQ</s:String> | ||
<s:String | ||
x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateInstanceFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String> | ||
<s:String | ||
x:Key="/Default/CodeStyle/Naming/CSharpNaming/PredefinedNamingRules/=PrivateStaticFields/@EntryIndexedValue"><Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /></s:String> | ||
<s:String x:Key="/Default/FilterSettingsManager/CoverageFilterXml/@EntryValue"><data><IncludeFilters /><ExcludeFilters /></data></s:String> | ||
<s:String x:Key="/Default/FilterSettingsManager/AttributeFilterXml/@EntryValue"><data /></s:String></wpf:ResourceDictionary> |
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 |
---|---|---|
@@ -1,14 +1,13 @@ | ||
using DbUp.Support; | ||
|
||
namespace DbUp.SqlCe | ||
namespace DbUp.SqlCe; | ||
|
||
/// <summary> | ||
/// Parses Sql Objects and performs quoting functions. | ||
/// </summary> | ||
public class SqlCeObjectParser : SqlObjectParser | ||
{ | ||
/// <summary> | ||
/// Parses Sql Objects and performs quoting functions. | ||
/// </summary> | ||
public class SqlCeObjectParser : SqlObjectParser | ||
public SqlCeObjectParser() : base("[", "]") | ||
{ | ||
public SqlCeObjectParser() : base("[", "]") | ||
{ | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,19 +1,18 @@ | ||
using System.Text.RegularExpressions; | ||
using DbUp.Engine; | ||
|
||
namespace DbUp.SqlCe | ||
namespace DbUp.SqlCe; | ||
|
||
/// <summary> | ||
/// This preprocessor makes minor adjustments to your sql to make it compatible with SqlCe. | ||
/// </summary> | ||
public class SqlCePreprocessor : IScriptPreprocessor | ||
{ | ||
/// <summary> | ||
/// This preprocessor makes minor adjustments to your sql to make it compatible with SqlCe. | ||
/// Performs some preprocessing step on a script | ||
/// </summary> | ||
public class SqlCePreprocessor : IScriptPreprocessor | ||
public string Process(string contents) | ||
{ | ||
/// <summary> | ||
/// Performs some preprocessing step on a script | ||
/// </summary> | ||
public string Process(string contents) | ||
{ | ||
return Regex.Replace(contents, @"nvarchar\s?\(max\)", "ntext", RegexOptions.IgnoreCase); | ||
} | ||
return Regex.Replace(contents, @"nvarchar\s?\(max\)", "ntext", RegexOptions.IgnoreCase); | ||
} | ||
} |
Oops, something went wrong.