How can I use custom schema with custom database table name in Nop 4.50

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
1 ano atrás
I am facing an issue with using a test.customer table which I created on database and I created its entity in Nop 4.50. The issue is while mapping this table into Nop 4.50 structure. My builder class looks like as followed:
table
                .InSchema("test")
                .WithColumn(NameCompatibilityManager.GetColumnName(typeof(TestCustomer), nameof(TestCustomer.CustomerId))).AsInt32()
                .ForeignKey<Customer>(onDelete: Rule.None).Nullable();

I also used BaseNameCompatibility class for mentioning the table name that I wanted to use. The class looks like below:

public class BaseNameCompatibility : INameCompatibility
    {
        public Dictionary<Type, string> TableNames => new() { { typeof(TestCustomer), "Customer" } };

        public Dictionary<(Type, string), string> ColumnName => throw new NotImplementedException();
    }

The error which I am getting is like as below:
    Microsoft.Data.Sqlite.SqliteException : SQLite Error 1: 'no such table: TestCustomer'.

Please help me out from in this. Thanks in advance.
1 ano atrás
In SQLite, it is not possible to have multiple schemas within the same database.
https://stackoverflow.com/questions/33960762/does-sqlite-support-multiple-schematas-within-the-same-database
1 ano atrás
Is it possible with SQL server ?
1 ano atrás
Saw this post https://github.com/nopSolutions/nopCommerce/issues/6139
1 ano atrás
Thank you @Yidna,

I was not knowing that this is actually a bug in Nopcommerce 4.50.1 too. I did the same changes on my local and it worked like charm... You saved my lots and lots of time.

Thank you very much..
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.