SQL-DROP-NO-EXISTS-001
DROP TABLE `#__lms_old`;
DROP TABLE without IF EXISTS
Reinstall and update SQL fail hard if the table is already gone. Joomla 4 installers expect IF EXISTS.
DROP TABLE `#__lms_old`; → DROP TABLE IF EXISTS `#__lms_old`;
What you will see
- SQLSTATE[42S02]
- Table doesn't exist
Symptoms people search
uninstall sql error · DROP TABLE
Replace this code
Swap DROP TABLE `#__lms_old`; for DROP TABLE IF EXISTS `#__lms_old`;.
Joomla 3
Remove or stop calling this
DROP TABLE `#__lms_courses`;Joomla 4 / 6
Use this instead
DROP TABLE IF EXISTS `#__lms_courses`;How to fix it
- 1Add IF EXISTS to every DROP in install/uninstall SQL.
Also known as
DROP TABLE · IF EXISTS
Related issues
- Joomla 3 → 4PHP
DS path constant
DS → DIRECTORY_SEPARATOR or /
- Joomla 3 → 4Events / plugins
JDispatcher / JEventDispatcher
JDispatcher::getInstance() → Event dispatcher + SubscriberInterface
- Joomla 3 → 4SQL / schema
MyISAM engine in install SQL
ENGINE=MyISAM → ENGINE=InnoDB
- Joomla 3 → 4SQL / schema
0000-00-00 dates
'0000-00-00 00:00:00' → NULL
- Joomla 3 → 4SQL / schema
SQL Server driver
sqlsrv → MySQL / MariaDB / PostgreSQL
- Joomla 4 → 5PHP
Dynamic PHP properties (PHP 8.2+)
$this->foo = 1 on an untyped class → Declare the property or use AllowDynamicProperties