model.schema(....) not setting model.$schema
See original GitHub issueWhat you are doing?
let myModel = sequelize.define('foo', {...});
myModel.schema('test');
myModel.find({...});
What do you expect to happen?
I want generated SQL statements to prefix the correct schema (“test”) to the model’s table name.
e.g. select ... from "test"."foo"...
What is actually happening?
The schema provided is not found in the generated SQL. This used to work in a previously used version… Updating my code to call myModel.$schema = 'test';
makes this work as expected. But the documentation should reflect that and/or the .schema()
should be fixed/removed
Dialect: postgres Database version: 9.4 Sequelize version: 4.0.0-0
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
node.js - Mongoose model schema referencing not working
I've the used populate method in mongoose to populate the referenced property in the model.But it is not working and I'm getting an...
Read more >Mongoose v6.8.2: Schemas
Schemas not only define the structure of your document and casting of properties, they also define document instance methods, static Model methods, ...
Read more >Custom schemas - dbt Developer Hub
If a custom schema is provided, a model's schema name should match the custom schema, rather than being concatenated to the target schema....
Read more >Schema - pydantic
Pydantic allows auto creation of JSON Schemas from models: ... exclusiveMaximum will not be enforce) class Model(BaseModel): foo: PositiveInt = Field(..., ...
Read more >Entity Framework Core Model Configuration
It is not possible to specify the default schema using Data Annotations attributes. Exclude a Type. The Ignore<TEntity>() method enables you to explicitly ......
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
Is there a reason why it clones the model class? It may have unintended side effects with the inheritance in v4
@mickhansen maybe this could be solved better by a
Model.clone()
method