Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#6139 Fix for db schemas after 4.50.0 update #6140

Merged
merged 1 commit into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Libraries/Nop.Data/DataProviders/BaseDataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ public virtual NopEntityDescriptor GetEntityDescriptor(Type entityType)
return new NopEntityDescriptor
{
EntityName = tableName,
SchemaName = builder.Expression.SchemaName,
Fields = builder.Expression.Columns.Select(column => new NopEntityFieldDescriptor
{
Name = column.Name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public FluentMigratorMetadataReader(IMappingEntityAccessor mappingEntityAccessor
var entityDescriptor = _mappingEntityAccessor.GetEntityDescriptor(type);

if (typeof(T) == typeof(TableAttribute))
return new TableAttribute(entityDescriptor.EntityName);
return new TableAttribute(entityDescriptor.EntityName) { Schema = entityDescriptor.SchemaName };

if (typeof(T) != typeof(ColumnAttribute))
return null;
Expand Down
3 changes: 2 additions & 1 deletion src/Libraries/Nop.Data/Mapping/NopEntityDescriptor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;

namespace Nop.Data.Mapping
{
Expand All @@ -10,6 +10,7 @@ public NopEntityDescriptor()
}

public string EntityName { get; set; }
public string SchemaName { get; set; }
public ICollection<NopEntityFieldDescriptor> Fields { get; set; }
}
}