Add support for DDL options (ALGORITHM, LOCK) and session parameters in Schema Builder #5154
joaoGabriel55
started this conversation in
Ideas
Replies: 2 comments
|
I can tackle this |
0 replies
|
Hello @joaoGabriel55 We are currently using Knex schema builder as it is, therefore adding new methods have to be done at the Knex level, so maybe you can do a proposal with them? |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem Statement
When running migrations on large production databases (particularly MySQL/MariaDB), executing non-blocking Online DDL operations is critical to prevent table locks and application downtime.
Currently, developers must resort to using
this.schema.raw()because the@adonisjs/lucidSchema Builder does not support:SET SESSION lock_wait_timeout = 5).ALGORITHM=INPLACE, LOCK=NONE).Current Workaround (Raw SQL):
Proposed Solution
Introduce fluent API methods or configuration options within
Schema/TableBuilderto support session settings and DDL flags.1. Session Variable Support
Allow setting session parameters directly on the schema builder instance:
2. Online DDL Options (
ALGORITHM/LOCK)Allow passing driver-specific flags when modifying tables or indexes:
Option A: Passed as options object to
alterTableOption B: Fluent modifier on index or table schema
Value Delivered
All reactions