Mail app impossible to re-enable after cleaning


My Mail app was not working at all, so I decided to disable the app, delete the folder /var/www/html/nextcloud/apps/mail and follow these instruction:

DELETE FROM oc_appconfig WHERE appid='mail';
DROP TABLE oc_mail_accounts, oc_mail_collected_addresses;

But I can’t re-enable the app, I’ve got this error message:
An exception occurred while executing 'CREATE TABLEoc_mail_aliases(idINT AUTO_INCREMENT NOT NULL,account_idINT DEFAULT 0 NOT NULL,nameVARCHAR(64) DEFAULT NULL,aliasVARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_bin ENGINE = InnoDB': SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'oc_mail_aliases' already exists

Any idea?

Thank you for your support!

Config : Nextcloud 13.0.2 on Debian 9

You’ve not finished removing tables from the database…

Thank you @JasonBayton ! I also forgot another one. So for the record, the full procedure is:

sudo rm -r /var/www/html/nextcloud/apps/mail
sudo mariadb -u root -p
USE nextcloud ;
DELETE FROM oc_appconfig WHERE appid=‘mail’;
DROP TABLE oc_mail_accounts, oc_mail_collected_addresses, oc_mail_aliases, oc_mail_attachments;