Repository navigation
Conversation
|
Does this replace #14477? |
|
Yep! It does fix the issue I mentioned but still checks whether a partially built query, that can include user-provided values (through I'll merge the necessary changes from that PR into this one |
|
I've been giving this some thought after the monthly and I think it would be nice to include this in a v7 alpha after all. Possibly a v7 beta but I'd like to minimize the number of breaking changes in the beta(s) as much as possible Do you agree? |
|
Just to check; this is still blocked by Any chance parts can be done already? Like migrating the enum functions to TS. |
|
Yep! I already introduced the internal query generator files & other similar refactors in a recent PR, the I added Those would already be pretty great. As for the rest, it's indeed mostly blocked by |
|
(ignore notification, was demoing something, sorry) |
|
Just wondering what the status of this PR is? I notice the last comments mention the issues with I'm working on a |
It's on hold. I think this will land somewhere later in v7 as an experimental feature and becomes the default in v8.
As far as I know, those have not been extracted yet but feel free to do so. |
Description Of Change
Closes #14477
Closes #15522
Closes #7649
Closes #15285
Closes #9635
Closes #13167
The initial goal of this PR was to investigate a bug reported here, it quickly turned out that
changeColumnhad a completely broken implementation and I opted for doing a complete rewrite and fixing many bugs in the process.changeColumnsI've added
changeColumnswhich is able to change more than one column from the same table in oneALTER TABLEquery, reducing the number of necessary queries.changeColumnsfollows our new API design, meaning it's possible to use it with a Model, a table name, a table object (table+schema), and it will default to the schema defined in the sequelize options if none is specified.That method also throws clear error messages when the user tries to do something out of its scope. Previously, it would just crash with an obscure message.
changeColumnjust defers tochangeColumns, and inherits from its features.All dialects
changeColumnsonly changes what has been provided. No more dropping the default value because it was not provided in the call. InsteaddropDefaultValuehas been added as an option. Similarly, the nullability of the column is only changed ifallowNullis explicitly set to true or false (undefined just does not change the definition at all).autoIncrement&autoIncrementIdentityModel.getTableName()returns a normalized table name object, including a normalized schema. This makes the rest of the implementation much easier as we can just normalize a table name at the start of each queryGenerator methods.Postgres
changeColumnsis able to replace an enum with another, drastically simplifying the modification of enums in migrations. Before, it was impossible to usechangeColumnto change the definition of a column's enum.Commit message
Todos