- What is orisintel/laravel-online-migrator and what problem does it solve?
- orisintel/laravel-online-migrator is a Laravel package that applies database migrations with minimal disruption by using tools such as Percona pt-online-schema-change. It targets large MySQL InnoDB tables where a normal ALTER TABLE can hold long locks and cause application downtime. The goal is to keep familiar Artisan-based migration workflows while making schema changes safer on production tables.
- Which Laravel and PHP versions does laravel-online-migrator support?
- The last release shown is from November 2020, which places it in the Laravel 6, 7, and 8 window. Laravel 9 reworked schema operations away from doctrine/dbal, and later versions continued that direction. You should expect compatibility work or a fork before using it on a current Laravel LTS, and verify PHP support in the package constraints.
- Does this package work with PostgreSQL, SQL Server, or SQLite?
- No, the package is designed around MySQL or MariaDB with InnoDB tables and Percona online schema change tooling. PostgreSQL has a different locking model and different tools such as CREATE INDEX CONCURRENTLY. SQL Server and SQLite are not meaningful targets for this package, so its value is zero on polyglot data layers.
- What prerequisites are required to install and run laravel-online-migrator?
- You need the Composer package plus the pt-online-schema-change binary installed on the machine that runs Artisan. The database user must be able to create and drop triggers, create and drop the shadow table, and read replication status. Managed MySQL services may restrict these privileges, so confirm them on the actual target before designing around the tool.
- Can I keep using normal Laravel migrate for small tables?
- You should verify in the source whether the package intercepts the entire migration run or supports opt-in per migration. The package is intended to replace blocking schema changes for large tables, not every migration. Keeping vanilla Laravel migrate for small tables is sensible where your integration allows it.
- How does laravel-online-migrator handle down migrations and failed cutovers?
- Mapping down() to a safe inverse is subtle, especially for multi-statement migrations and foreign keys. A failed pt-online-schema-change cutover is not atomic and can leave triggers or a _table_new shadow table behind because MySQL does not have transactional DDL. You need a documented cleanup and restore path and should rehearse it before production use.
- Does laravel-online-migrator support gh-ost or only Percona Toolkit?
- The primary target described is Percona pt-online-schema-change. The context mentions gh-ost only as a possible driver, not as a confirmed first-class feature. Treat gh-ost support as unproven unless you verify it directly in the package source.
- Is laravel-online-migrator safe and actively maintained for production use?
- The maintenance signal is weak: the package has around 44 stars, a single-release history, and no visible downstream base. The blast radius of a defect here is production schema, so source review and a fork you control are prerequisites rather than optional diligence. Rehearse the failure and cleanup path before trusting it with critical tables.
- What database privileges and managed MySQL limitations affect pt-online-schema-change?
- pt-online-schema-change needs privileges to create and drop triggers, create and drop the shadow table, and read replication status. RDS, Aurora, and Cloud SQL can constrain SUPER, trigger creation, and binlog settings in ways that materially affect the tool. Confirm privileges and behavior on your specific managed MySQL tier before relying on it.
- What are alternatives to laravel-online-migrator for zero-downtime Laravel migrations?
- You can run pt-online-schema-change or gh-ost directly as part of a controlled migration runbook. For PostgreSQL, use database-specific approaches such as CREATE INDEX CONCURRENTLY rather than this package. Another option is to fork this package and maintain compatibility with your Laravel version, but only after a timeboxed spike proves it works on your target database.