downgrade SQL connector version, context changes

This commit is contained in:
RaidMax 2018-04-06 21:06:43 -05:00
parent 466b273736
commit 6f2e0bfff1
4 changed files with 10 additions and 6 deletions

View File

@ -6,7 +6,7 @@ using System.Data.SqlServerCe;
namespace SharedLibrary.Database namespace SharedLibrary.Database
{ {
class ContextConfiguration : DbConfiguration public class ContextConfiguration : DbConfiguration
{ {
public ContextConfiguration() public ContextConfiguration()
{ {
@ -20,10 +20,10 @@ namespace SharedLibrary.Database
else else
{ {
/* SetExecutionStrategy("MySql.Data.MySqlClient", () => new DefaultExecutionStrategy()); SetExecutionStrategy("MySql.Data.MySqlClient", () => new DefaultExecutionStrategy());
SetProviderFactory("MySql.Data.MySqlClient", new MySql.Data.MySqlClient.MySqlClientFactory()); SetProviderFactory("MySql.Data.MySqlClient", new MySql.Data.MySqlClient.MySqlClientFactory());
SetProviderServices("MySql.Data.MySqlClient", new MySql.Data.MySqlClient.MySqlProviderServices()); SetProviderServices("MySql.Data.MySqlClient", new MySql.Data.MySqlClient.MySqlProviderServices());
SetDefaultConnectionFactory(new MySql.Data.Entity.MySqlConnectionFactory());*/ SetDefaultConnectionFactory(new MySql.Data.Entity.MySqlConnectionFactory());
} }
} }
} }

View File

@ -63,12 +63,12 @@ namespace SharedLibrary.Database
IEnumerable<string> directoryFiles; IEnumerable<string> directoryFiles;
try try
{ {
directoryFiles = Directory.GetFiles($@"{Environment.CurrentDirectory}\bin\x86\Debug\Plugins").Where(f => f.Contains(".dll")); directoryFiles = Directory.GetFiles($@"{Environment.CurrentDirectory}{Path.DirectorySeparatorChar}bin{Path.DirectorySeparatorChar}x86{Path.DirectorySeparatorChar}Debug{Path.DirectorySeparatorChar}Plugins").Where(f => f.Contains(".dll"));
} }
catch (Exception) catch (Exception)
{ {
directoryFiles = Directory.GetFiles($@"{Environment.CurrentDirectory}\Plugins").Where(f => f.Contains(".dll")); directoryFiles = Directory.GetFiles($@"{Environment.CurrentDirectory}{Path.DirectorySeparatorChar}Plugins").Where(f => f.Contains(".dll"));
} }
foreach (string dllPath in directoryFiles) foreach (string dllPath in directoryFiles)

View File

@ -11,6 +11,10 @@ namespace SharedLibrary.Migrations
{ {
AutomaticMigrationsEnabled = true; AutomaticMigrationsEnabled = true;
AutomaticMigrationDataLossAllowed = true; AutomaticMigrationDataLossAllowed = true;
if (Utilities.IsRunningOnMono())
{
SetSqlGenerator("MySql.Data.MySqlClient", new MySql.Data.Entity.MySqlMigrationSqlGenerator());
}
} }
protected override void Seed(SharedLibrary.Database.DatabaseContext context) protected override void Seed(SharedLibrary.Database.DatabaseContext context)

View File

@ -244,7 +244,7 @@
<Version>6.10.6</Version> <Version>6.10.6</Version>
</PackageReference> </PackageReference>
<PackageReference Include="MySql.Data.Entity"> <PackageReference Include="MySql.Data.Entity">
<Version>6.10.6</Version> <Version>6.9.11</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Newtonsoft.Json"> <PackageReference Include="Newtonsoft.Json">
<Version>11.0.1</Version> <Version>11.0.1</Version>