Comments (7)
Note for when someone starts working on this task: there are some information about this in #17256
from sequelize.
What if we delete all the constraint of particular table before hand as it is already creating that constraint again look into following code.
from sequelize.
sync
cannot delete anything unless force
is specified, in which case it deletes everything
from sequelize.
sync
cannot delete anything unlessforce
is specified, in which case it deletes everything
you don't get my point I want to do something like this
from sequelize.
Other thing that I have noticed that If we remove reference from a field (and it is still in the model mean we don't remove the field but just the references) it reference in database will not be removed as we are only removing constraint from the field which have some references in the code.
from sequelize.
To explain what I meant in my previous comment: removing constraints is a destructive operation, and the base sync
does not do that. I see that in your initial comment you mentioned using the alter
option, which could do this kind of operation
from sequelize.
What about if we add name constraint and check if it is not exist with that name and drop if exists
adding name constraint
from sequelize.
Related Issues (20)
- Customize toJSON() for custom serialization logic HOT 6
- Can't make table queries. TypeError: _.includes is not a function HOT 1
- DATE parse function crashes in SQLite HOT 1
- PostgreSQL. Error in getQueryInterface().describeTable() with column comments and schemas
- Unable to find dialect at HOT 2
- Cyclic sequelize sync doesn't handle several cases in the non-cyclic version HOT 1
- Introducing @EncryptedAttribute() decorator
- Add `Model.exists()` to allow efficient checking of at least one matching row
- Filter As on Properties of Associated Bs But Still Return all Bs Associated to the Resulting A's
- Feature Request: support 'schema' for MySQL HOT 1
- Merge Failure When Using Raw Where Query With Scope HOT 2
- Recieving sqlite related errors, but dialect used is postgres
- An In-Class @Scope Decorator HOT 1
- Add method for accessing #transactionCls Sequelize v7
- 使用webpack5 打包 后报错 TypeError: i is not a function
- `unique: true` does not generate same index name and constraint in model and migrations
- Please include src/ in public package if you're going to publish source maps
- Node.js start fails on Linux platform due to invalid ELF header error HOT 1
- Weird Failure When Using this.reload(); "Cannot use offset or limit without a model or order being set" HOT 2
- Raw Queries with multiple Bind Parameters and in wrong order not working properly - (tested on Oracle)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sequelize.