I hope this message finds you well.
We are currently using your ABP Commercial framework for our project, and we are facing a challenge related to database migrations. Specifically, we need to utilize the ALGORITHM=INSTANT option in MySQL for certain ALTER TABLE operations to avoid database locks and ensure zero-downtime deployments. However, we have noticed that the current migration framework does not support this option.
We would like to inquire if there is any possibility to extend or customize the migration framework to accommodate the use of ALGORITHM=INSTANT. If there is an existing way to achieve this, we would greatly appreciate any guidance or documentation you could provide.
Thank you in advance for your assistance. We look forward to your advice on how best to proceed.
Best regards,
- ABP Framework version: v8.2
- UI Type: Angular
- Database System: EF Core (MySQL.)
15 Answer(s)
-
0
Thank you for reaching out.
It is possible to use ALGORITHM=INSTANT without ABP Commercial. However, when using EF Core for migrations, applying specific options like ALGORITHM=INSTANT to an ALTER TABLE command might require manually running the SQL or customizing the migration scripts to include this option.
If EF Core migrations do not support this option by default, we might need to consider executing custom scripts before or after the migration to ensure the database lock is minimized.
Our goal is to achieve zero-downtime releases by minimizing database locks. We would appreciate any further guidance or suggestions you could provide on this matter.
Best regards,
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
hi
You can add your custom SQL statement during migration
see https://learn.microsoft.com/en-us/ef/core/managing-schemas/migrations/operations
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Thank you for the suggestion. I understand that using migrationBuilder.Sql allows us to add custom SQL during migration. However, I'm looking for a way to achieve this directly through EF Core's built-in migration functionality without having to manually insert SQL statements.
Our goal is to keep our migration process as consistent and maintainable as possible within the framework provided by EF Core. If there is an alternative approach or any upcoming features that might support this requirement natively, I would appreciate any guidance or suggestions you could offer.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
hi
We can only solve problems related to abp. We have no relevant experience in your case.
Sorry for that.
You can try to google it or ask for a solution in EF Core https://github.com/dotnet/efcore/issues/new/choose
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)