The column "TenantId" does not exist
See original GitHub issueI use latest FB preview, EF 3.1.4 for PostgreSQL. I am not sure what is the source of the problem but i receive the exception during query my Customers Set: Column does not exist: i.e. I see the query
{SELECT c.id, c.accounts_contact, c.address,c.name, c.tel, c."TenantId", c.towncity, c.web
FROM customers AS c
WHERE c."TenantId" = $1}
The matter is: the field “TenantId” was added (why) to the correct query, but it is not in the table and naturally PostgreSQL error. Why the field “TenantId” is in the query? How I can fix it?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
SpringBoot + PostgreSQL "Column does not exist"
This can be caused because your database schema is not in synced with your Entity class. My advice is to inspect your database...
Read more >How to Fix Column Does not Exist Exception/Error in ...
In PostgreSQL, the “column doesn't exist” error can occur because of various reasons, such as the searched column doesn't exist in the targeted ......
Read more >Unique Constraint on 2 columns or single column and null ...
Name AND NOT EXISTS (SELECT i.TenantId INTERSECT SELECT it.TenantId) -- nullable compare AND (i.TenantId IS NULL OR it.TenantId IS NULL) ...
Read more >Serverless SQL pool self-help - Azure Synapse Analytics
This article contains information that can help you troubleshoot problems with serverless SQL pool.
Read more >Not authorized or invalid query (System tree ...
The query status shows blank. The following error is seen in the console: Not authorized or invalid query. Not authorized or invalid query...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi, In the sample two of them should be sharing a single database and one should have it’s own. I’ll double check it today and maybe I can make it more clear. I think it might be clearer to have separate sample projects like you say but also to have the existing one-there are cases where you might have a mix of shared and separate databases.
@win32nipuh
Based on your email I would recommend that your db context NOT derive from
MultiTenantDbContext
. It’s main functionality is to support tenants sharing a database, but your use case is separate database per tenant.In your case I recommend you inherit from the normal
DbContext', inject the tenant info into the constructor, and set the connection in
OnConfiguringusing the tenant info
ConnectionString`.