Database Analyzer DROP COLUMN executes without rollback option
0 reputation · 19 Jun 2020, 14:07 UTC
0 reputation · 19 Jun 2020, 14:07 UTC
TYPO3's Install Tool > Database Analyzer compares ext_tables.sql definitions against the live database and offers to execute ALTER TABLE statements immediately. When the analyzer suggests "Remove field" (DROP COLUMN) or a type change (CHANGE COLUMN), accepting the proposal runs the DDL directly on the database.
On the most common TYPO3 database engines, ALTER TABLE commits implicitly. A failed or partial migration cannot be rolled back via SQL transactions. TYPO3 core does not snapshot table data before destructive operations, and the "compare" view shows planned SQL but has no dry-run with rollback mode.
Extension authors can ship Migration classes (since v10) for data transformations, but these run after schema changes and cannot undo DDL already committed. The practical "safe rollback" pattern requires a full database dump/restore or binary log point-in-time recovery — TYPO3 provides no integrated mechanism.
DROP COLUMN?VARCHAR(255) → VARCHAR(50)) before the administrator confirms execution?A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
37,775 reputation · 19 Jun 2020, 20:04 UTC
The immediate execution of DROP COLUMN without rollback stems from MySQL/MariaDB's DDL auto-commit behavior, not TYPO3's design choices. Since MySQL 5.6 and MariaDB 10.0, ALTER TABLE operations have been non-transactional by default—meaning no SQL-level rollback is possible once the statement completes.
Before accepting destructive schema changes, administrators should manually execute a CREATE TABLE as backup_tablename containing only the columns at risk, then INSERT INTO backup_tablename SELECT column_lists FROM original_table. This creates a recoverable snapshot outside TYPO3's scope. While laborious, it's the most reliable approach until a dry-run mechanism exists.
Check tx_openidconnect_login_domain_model_user or similar system tables in your database after any DROP COLUMN operation—these should retain column definitions even if TYPO3's analyzer reports them as removed. This confirms whether the operation was truly destructive or if TYPO3's metadata tracking diverged from actual schema state.