Skip to content

Commit

Permalink
Added list of tables to the call of GetSqlSourceSchema. bump version …
Browse files Browse the repository at this point in the history
…to 10.0.8
  • Loading branch information
MatthiasSort committed Oct 24, 2023
1 parent 40f3c4e commit 8589c43
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>10.0.7</Version>
<Version>10.0.8</Version>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
<Title>Ecom Provider</Title>
<Description>Ecom Provider</Description>
Expand Down
17 changes: 4 additions & 13 deletions src/EcomProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ public override Schema GetOriginalSourceSchema()
return GetSchema(false);
}

private Schema GetDynamicwebSourceSchema()
private Schema GetDynamicwebSourceSchema(IEnumerable<string> tableNames)
{
Schema result = GetSqlSourceSchema(Connection);
Schema result = GetSqlSourceSchema(Connection, tableNames);
//set key for AccessUserTable
if (UserKeyField != null)
{
Expand Down Expand Up @@ -264,21 +264,12 @@ private Schema GetDynamicwebSourceSchema()
/// <returns></returns>
public Schema GetSchema(bool getForDestination)
{
Schema result = GetDynamicwebSourceSchema();
List<string> tablestToKeep = new()
{ "EcomProducts", "EcomManufacturers", "EcomGroups", "EcomVariantGroups", "EcomVariantsOptions",
"EcomProductsRelated", "EcomProductItems", "EcomStockUnit", "EcomDetails","EcomProductCategoryFieldValue", "EcomLanguages", "EcomPrices",
"EcomAssortmentGroupRelations", "EcomAssortmentPermissions", "EcomAssortmentProductRelations", "EcomAssortments", "EcomAssortmentShopRelations", "EcomVariantOptionsProductRelation"};
List<Table> tablesToRemove = new();
foreach (Table table in result.GetTables())
{
if (!tablestToKeep.Contains(table.Name))
tablesToRemove.Add(table);
}
foreach (Table table in tablesToRemove)
{
result.RemoveTable(table);
}
Schema result = GetDynamicwebSourceSchema(tablestToKeep);

foreach (Table table in result.GetTables())
{
switch (table.Name)
Expand Down

0 comments on commit 8589c43

Please sign in to comment.