Refrain from using transactions in migrations when targeting YugabyteDB
YugabyteDB doesn't (currently) support running DDL within transactions; we can add a YugabyteDB compatibility config, and refrain from using transactions.
In the meantime, a good workaround is to generate the migrations as a SQL script, and run that.
Originally raised as https://github.com/dotnet/efcore/issues/30881
/cc @FranckPachot
Any update on this?
Nope, if there were it would be posted here.
YugabtyeDB now supports transactional DDL in tech preview: https://docs.yugabyte.com/stable/explore/transactions/transactional-ddl/
Thanks @FranckPachot, that's great news. That's the best solution here.
Apologies, question for update was about postgres not YugabyteDb, I came across the link for issue #30881.
@pantonis I don't understand, what's your question exactly? Why are you trying to disable migration transactions on PostgreSQL?
Some of the commands that we need to run cannot run inside transactions.
Hi everyone,
We wanted to provide an official update on this request. As informed by @FranckPachot , the feature is already present in Tech preview and will work if enabled explicitly by following the steps. The feature will be enabled by default in our future release coming early next year.
You can follow the implementation progress in our public tracking issue here: https://github.com/yugabyte/yugabyte-db/issues/3109
Thank you for your patience and continued interest. We’ll share updates as we get closer to the release.
Some of the commands that we need to run cannot run inside transactions.
@pantonis that's unrelated to this issue, which is about the provider globally not ever using transactions. EF already allows you to suppress transactions for specific operations when including custom SQL, see these docs.
As Yugabyte is introducing support for migrations, I'll go ahead and close this issue.