mstilkerich / rcmcarddav

CardDAV plugin for RoundCube Webmailer
GNU General Public License v2.0
256 stars 81 forks source link

Table 'carddav_migrations' already exists #444

Closed Mymko closed 1 year ago

Mymko commented 1 year ago

roundcube version 1.6.1 carddav version 5.0.1 Clean install. In addition to the fact that the tables were not automatically made, and I had to manually add tables from plugins/carddav/dbmigrations/INIT-currentschema/mysql.sql There is always an error in the logs:

[5 ERR] Migration query (

CREATE TABLE carddav_migrations (
     `ID` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY ,
     `filename` VARCHAR( 64 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
     `processed_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
     UNIQUE(
         `filename`
     )
) ROW_FORMAT=DYNAMIC ENGINE=InnoDB CHARACTER SET utf8 COLLATE utf8_unicode_ci;) failed: [1050] Table 'carddav_migrations' already exists

How to solve it?

mstilkerich commented 1 year ago

Well the thing is it is not just about creating the tables but also recording the schema version. Otherwise it will try to create the table again.

I suggest you drop the tables you created and let rcmcarddav create the tables. To drop the tables, run plugins/carddav/scripts/dropdb.php inside the roundcube main directory.

The important part is the database tables are created when you log into roundcube, so log out first and back in if needed. I guess you did not do this first. Now you get these errors and they tell you that in fact rcmcarddav does try to create the tables during login.

mstilkerich commented 1 year ago

No feedback and no issue in rcmcarddav - closing assuming this is resolved. If not just comment in this issue.