Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added setNullable support to SQLite #4684

Merged
merged 3 commits into from Sep 19, 2021
Merged

Added setNullable support to SQLite #4684

merged 3 commits into from Sep 19, 2021

Conversation

aidenfoxx
Copy link
Contributor

@aidenfoxx aidenfoxx commented Sep 18, 2021

As discussed in #4681 I've added support for setNullable and dropNullable to the SQLite dialect.

Hopefully I didn't miss anything!

@kibertoad kibertoad merged commit c778c82 into knex:master Sep 19, 2021
@aidenfoxx
Copy link
Contributor Author

aidenfoxx commented Sep 19, 2021

Just a question for @nickrum when he gets a chance:

In #ed0e8a I notice you updated the alterColumn DDL to use this.alter rather than this.generateAlterCommands. Judging by the commit message, there is a good reason for the change. However, @kibertoad encouraged me to use this.generateAlterCommands since it returns the distinct statements of the function.

Anyway, my point is, which is correct way of doing things since there is clearly issues with both ways?

@kibertoad
Copy link
Collaborator

@aidenfoxx Judging by skipped test, it looks more like a hack than a proper solution. I still believe that generateAlterCommands is a better choice.

rustyconover pushed a commit to rustyconover/knex that referenced this pull request Oct 18, 2021
OlivierCavadenti pushed a commit to AbeonaPascha/knex that referenced this pull request Nov 4, 2021
@nickrum
Copy link
Contributor

nickrum commented Dec 15, 2021

@aidenfoxx The problem with generateAlterCommands was that the generated commands weren't executed in a transaction, so if there was an error while executing one of the alter statements, the database might be left in some in-between-state without a way to revert back. This was IMO worse than not being able to generate the commands.

Now that #4189 has been merged, using generateAlterCommands should be as safe as using alter, so I reverted the hotfix in #4896.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants