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

Add Native Support for ALGORITHM=INSTANT in Migrations for MYSQL #2323

Open
abhikaddy opened this issue Nov 26, 2024 · 0 comments
Open

Add Native Support for ALGORITHM=INSTANT in Migrations for MYSQL #2323

abhikaddy opened this issue Nov 26, 2024 · 0 comments

Comments

@abhikaddy
Copy link

abhikaddy commented Nov 26, 2024

Currently, phinx does not natively support specifying ALGORITHM=INSTANT for MySQL migrations. ALGORITHM=INSTANT allows for schema changes (like adding columns) without requiring a table copy or affecting existing data, offering significant performance and downtime advantages for compatible operations.

This feature would enhance the flexibility and efficiency of database schema migrations, especially for users leveraging MySQL 8.0+ where ALGORITHM=INSTANT is available for certain DDL operations.

Proposed Solution:

Introduce a method or syntax in migrations to allow developers to specify the use of ALGORITHM=INSTANT explicitly for operations that support it.
Example:
$table->addColumn('new_column', 'string', ['algorithm' => 'instant'])->update();
Ensure fallback behavior is clearly defined if ALGORITHM=INSTANT is unsupported by the MySQL version or for the requested operation.
Benefits

Reduces downtime and performance impact during migrations for supported schema changes.
Aligns phinx with modern database practices and MySQL optimizations.
MySQL documentation on ALGORITHM=INSTANT.

Adding this feature will provide a smoother migration experience, particularly for large-scale production environments. It would also make phinx more competitive by leveraging cutting-edge database features.

Please let me know if further clarification or input is required!

@abhikaddy abhikaddy changed the title Add Native Support for ALGORITHM=INSTANT in Migrations Add Native Support for ALGORITHM=INSTANT in Migrations for MYSQL Nov 26, 2024
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

No branches or pull requests

1 participant