# Database upgrade failure

**URL:** <https://forum.mautic.org/t/database-upgrade-failure/7808>\
**Category:** Product Support\
**Created:** [March 6, 2017, 8:35am UTC](https://forum.mautic.org/t/database-upgrade-failure/7808 "2017-03-06T08:35:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![waverider](https://avatars.discourse-cdn.com/v4/letter/w/49beb7/32.png) [@waverider](https://forum.mautic.org/u/waverider)\
**Post date:** [March 6, 2017, 8:35am UTC](https://forum.mautic.org/t/database-upgrade-failure/7808/1 "2017-03-06T08:35:14Z")

</div>

Hello,  
  
I am new to Mautic and having a database problem. In attempting to upgrade from 2.5.1 to 2.6.1 the file upgrade worked OK but the database upgrade failed. I went back to 2.5.1 from backups and then attempted to upgrade/repair the database using [http://mymauticsite.com/s/upgrade/schema](http://mymauticsite.com/s/upgrade/schema) but this also failed.  
  
the log shows as below but i am unable to interpret the log to identify and fix the problem.  
  
Perhaps someone can help?  
  
Thanks  
  
  
  
Log Entries:  
  
  
  
[2017-03-06 19:18:15] mautic.NOTICE: DoctrineDBALExceptionDriverException: An exception occurred while executing ‘ALTER TABLE mauyu\_campaign\_events ADD channel VARCHAR(255) DEFAULT NULL, ADD channel\_id INTEGER DEFAULT NULL, ADD INDEX mauyu\_campaign\_event\_channel (channel, channel\_id), DROP INDEX mauyu\_campaign\_event\_type\_search, ADD INDEX mauyu\_campaign\_event\_search (`type`, event\_type), DROP INDEX mauyu\_event\_type, ADD INDEX mauyu\_campaign\_event\_type (event\_type)’: Can’t DROP ‘mauyu\_campaign\_event\_type\_search’; check that column/key exists (uncaught exception) at /home/mysite/public\_html/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 115 while running console command `doctrine:migrations:migrate` [] []  
  
[2017-03-06 19:18:15] mautic.ERROR: [UPGRADE ERROR] Exit code 1; Mautic Migrations Migrating up to 20170127205928 from 20161124145649 ++ migrating 20161026202839 -\> CREATE TABLE mauyu\_message\_channels ( id INT AUTO\_INCREMENT NOT NULL, message\_id INT NOT NULL, channel VARCHAR(255) NOT NULL, channel\_id INT NULL, properties LONGTEXT NOT NULL COMMENT ‘(DC2Type:json\_array)’, is\_enabled TINYINT(1) NOT NULL, INDEX IDX\_118ADA5E537A1329 (message\_id), INDEX mauyu\_channel\_entity\_index (channel, channel\_id), INDEX mauyu\_channel\_enabled\_index (channel, is\_enabled), UNIQUE INDEX mauyu\_channel\_index (message\_id, channel), PRIMARY KEY(id) ) DEFAULT CHARACTER SET utf8 COLLATE utf8\_unicode\_ci ENGINE = InnoDB; -\> CREATE TABLE mauyu\_messages ( id INT AUTO\_INCREMENT NOT NULL, category\_id INT DEFAULT NULL, is\_published TINYINT(1) NOT NULL, date\_added DATETIME DEFAULT NULL COMMENT ‘(DC2Type:datetime)’, created\_by INT DEFAULT NULL, created\_by\_user VARCHAR(255) DEFAULT NULL, date\_modified DATETIME DEFAULT NULL COMMENT ‘(DC2Type:datetime)’, modified\_by INT DEFAULT NULL, modified\_by\_user VARCHAR(255) DEFAULT NULL, checked\_out DATETIME DEFAULT NULL COMMENT ‘(DC2Type:datetime)’, checked\_out\_by INT DEFAULT NULL, checked\_out\_by\_user VARCHAR(255) DEFAULT NULL, name VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, publish\_up DATETIME DEFAULT NULL COMMENT ‘(DC2Type:datetime)’, publish\_down DATETIME DEFAULT NULL COMMENT ‘(DC2Type:datetime)’, INDEX IDX\_3D41E7812469DE2 (category\_id), INDEX mauyu\_date\_message\_added (date\_added), PRIMARY KEY(id) ) DEFAULT CHARACTER SET utf8 COLLATE utf8\_unicode\_ci ENGINE = InnoDB; -\> ALTER TABLE mauyu\_message\_channels ADD CONSTRAINT FK\_118ADA5E537A1329 FOREIGN KEY (message\_id) REFERENCES mauyu\_messages (id) ON DELETE CASCADE -\> ALTER TABLE mauyu\_messages ADD CONSTRAINT FK\_3D41E7812469DE2 FOREIGN KEY (category\_id) REFERENCES mauyu\_categories (id) ON DELETE SET NULL ++ migrated (0.35s) ++ migrating 20161122215214 -\> ALTER TABLE mauyu\_push\_notifications ADD button LONGTEXT NOT NULL ++ migrated (0.33s) ++ migrating 20161125002837 -\> ALTER TABLE mauyu\_lead\_devices ADD device\_fingerprint VARCHAR(255) DEFAULT NULL -\> CREATE INDEX mauyu\_device\_fingerprint\_search ON mauyu\_lead\_devices (device\_fingerprint) ++ migrated (0.32s) ++ migrating 20161222183556 -\> CREATE TABLE mauyu\_saml\_id\_entry ( id VARCHAR(255) NOT NULL, entity\_id VARCHAR(255) NOT NULL, expiryTimestamp INT NOT NULL, PRIMARY KEY(id, entity\_id) ) DEFAULT CHARACTER SET utf8 COLLATE utf8\_unicode\_ci ENGINE = InnoDB ++ migrated (0.35s) ++ migrating 20170106102310 -\> ALTER TABLE mauyu\_campaign\_events ADD channel VARCHAR(255) DEFAULT NULL, ADD channel\_id INTEGER DEFAULT NULL, ADD INDEX mauyu\_campaign\_event\_channel (channel, channel\_id), DROP INDEX mauyu\_campaign\_event\_type\_search, ADD INDEX mauyu\_campaign\_event\_search (`type`, event\_type), DROP INDEX mauyu\_event\_type, ADD INDEX mauyu\_campaign\_event\_type (event\_type) Migration 20170106102310 failed during Execution. Error An exception occurred while executing ‘ALTER TABLE mauyu\_campaign\_events ADD channel VARCHAR(255) DEFAULT NULL, ADD channel\_id INTEGER DEFAULT NULL, ADD INDEX mauyu\_campaign\_event\_channel (channel, channel\_id), DROP INDEX mauyu\_campaign\_event\_type\_search, ADD INDEX mauyu\_campaign\_event\_search (`type`, event\_type), DROP INDEX mauyu\_event\_type, ADD INDEX mauyu\_campaign\_event\_type (event\_type)’: Can’t DROP ‘mauyu\_campaign\_event\_type\_search’; check that column/key exists [DoctrineDBALExceptionDriverException] An exception occurred while executing ‘ALTER TABLE mauyu\_campaign\_events ADD channel VARCHAR(255) DEFAULT NULL, ADD channel\_id INTEGER DEFAULT NULL, ADD INDEX mauyu\_campaign\_event\_channel (channel, channel\_id), DROP INDEX mauyu\_campaign\_event\_type\_search, ADD INDEX mauyu\_campaign\_event\_search (`type`, event\_type), DROP INDEX mauyu\_event\_type, ADD INDEX mauyu\_campaign\_event\_type (event\_type)’: Can’t DROP ‘mauyu\_campaign\_event\_type\_search’; check that column/key exists [DoctrineDBALDriverMysqliMysqliException] Can’t DROP ‘mauyu\_campaign\_event\_type\_search’; check that column/key exists doctrine:migrations:migrate ] ] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [-n|–no-interaction] [-s|–shell] [-e|–env ENV] [] [] []

---

<div class="post-metadata">

**Author:** ![waverider](https://avatars.discourse-cdn.com/v4/letter/w/49beb7/32.png) [@waverider](https://forum.mautic.org/u/waverider)\
**Post date:** [March 6, 2017, 8:35am UTC](https://forum.mautic.org/t/database-upgrade-failure/7808/2 "2017-03-06T08:35:14Z")

</div>

Hello,  
I am new to Mautic and having a database problem. In attempting to upgrade from 2.5.1 to 2.6.1 the file upgrade worked OK but the database upgrade failed. I went back to 2.5.1 from backups and then attempted to upgrade/repair the database using [http://mymauticsite.com/s/upgrade/schema](http://mymauticsite.com/s/upgrade/schema) but this also failed.  
the log shows as below but i am unable to interpret the log to identify and fix the problem.  
Perhaps someone can help?  
Thanks

Log Entries:

[2017-03-06 19:18:15] mautic.NOTICE: DoctrineDBALExceptionDriverException: An exception occurred while executing ‘ALTER TABLE mauyu\_campaign\_events ADD channel VARCHAR(255) DEFAULT NULL, ADD channel\_id INTEGER DEFAULT NULL, ADD INDEX mauyu\_campaign\_event\_channel (channel, channel\_id), DROP INDEX mauyu\_campaign\_event\_type\_search, ADD INDEX mauyu\_campaign\_event\_search (`type`, event\_type), DROP INDEX mauyu\_event\_type, ADD INDEX mauyu\_campaign\_event\_type (event\_type)’: Can’t DROP ‘mauyu\_campaign\_event\_type\_search’; check that column/key exists (uncaught exception) at /home/mysite/public\_html/mautic/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php line 115 while running console command `doctrine:migrations:migrate` [] []  
[2017-03-06 19:18:15] mautic.ERROR: [UPGRADE ERROR] Exit code 1; Mautic Migrations Migrating up to 20170127205928 from 20161124145649 ++ migrating 20161026202839 -\> CREATE TABLE mauyu\_message\_channels ( id INT AUTO\_INCREMENT NOT NULL, message\_id INT NOT NULL, channel VARCHAR(255) NOT NULL, channel\_id INT NULL, properties LONGTEXT NOT NULL COMMENT ‘(DC2Type:json\_array)’, is\_enabled TINYINT(1) NOT NULL, INDEX IDX\_118ADA5E537A1329 (message\_id), INDEX mauyu\_channel\_entity\_index (channel, channel\_id), INDEX mauyu\_channel\_enabled\_index (channel, is\_enabled), UNIQUE INDEX mauyu\_channel\_index (message\_id, channel), PRIMARY KEY(id) ) DEFAULT CHARACTER SET utf8 COLLATE utf8\_unicode\_ci ENGINE = InnoDB; -\> CREATE TABLE mauyu\_messages ( id INT AUTO\_INCREMENT NOT NULL, category\_id INT DEFAULT NULL, is\_published TINYINT(1) NOT NULL, date\_added DATETIME DEFAULT NULL COMMENT ‘(DC2Type:datetime)’, created\_by INT DEFAULT NULL, created\_by\_user VARCHAR(255) DEFAULT NULL, date\_modified DATETIME DEFAULT NULL COMMENT ‘(DC2Type:datetime)’, modified\_by INT DEFAULT NULL, modified\_by\_user VARCHAR(255) DEFAULT NULL, checked\_out DATETIME DEFAULT NULL COMMENT ‘(DC2Type:datetime)’, checked\_out\_by INT DEFAULT NULL, checked\_out\_by\_user VARCHAR(255) DEFAULT NULL, name VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, publish\_up DATETIME DEFAULT NULL COMMENT ‘(DC2Type:datetime)’, publish\_down DATETIME DEFAULT NULL COMMENT ‘(DC2Type:datetime)’, INDEX IDX\_3D41E7812469DE2 (category\_id), INDEX mauyu\_date\_message\_added (date\_added), PRIMARY KEY(id) ) DEFAULT CHARACTER SET utf8 COLLATE utf8\_unicode\_ci ENGINE = InnoDB; -\> ALTER TABLE mauyu\_message\_channels ADD CONSTRAINT FK\_118ADA5E537A1329 FOREIGN KEY (message\_id) REFERENCES mauyu\_messages (id) ON DELETE CASCADE -\> ALTER TABLE mauyu\_messages ADD CONSTRAINT FK\_3D41E7812469DE2 FOREIGN KEY (category\_id) REFERENCES mauyu\_categories (id) ON DELETE SET NULL ++ migrated (0.35s) ++ migrating 20161122215214 -\> ALTER TABLE mauyu\_push\_notifications ADD button LONGTEXT NOT NULL ++ migrated (0.33s) ++ migrating 20161125002837 -\> ALTER TABLE mauyu\_lead\_devices ADD device\_fingerprint VARCHAR(255) DEFAULT NULL -\> CREATE INDEX mauyu\_device\_fingerprint\_search ON mauyu\_lead\_devices (device\_fingerprint) ++ migrated (0.32s) ++ migrating 20161222183556 -\> CREATE TABLE mauyu\_saml\_id\_entry ( id VARCHAR(255) NOT NULL, entity\_id VARCHAR(255) NOT NULL, expiryTimestamp INT NOT NULL, PRIMARY KEY(id, entity\_id) ) DEFAULT CHARACTER SET utf8 COLLATE utf8\_unicode\_ci ENGINE = InnoDB ++ migrated (0.35s) ++ migrating 20170106102310 -\> ALTER TABLE mauyu\_campaign\_events ADD channel VARCHAR(255) DEFAULT NULL, ADD channel\_id INTEGER DEFAULT NULL, ADD INDEX mauyu\_campaign\_event\_channel (channel, channel\_id), DROP INDEX mauyu\_campaign\_event\_type\_search, ADD INDEX mauyu\_campaign\_event\_search (`type`, event\_type), DROP INDEX mauyu\_event\_type, ADD INDEX mauyu\_campaign\_event\_type (event\_type) Migration 20170106102310 failed during Execution. Error An exception occurred while executing ‘ALTER TABLE mauyu\_campaign\_events ADD channel VARCHAR(255) DEFAULT NULL, ADD channel\_id INTEGER DEFAULT NULL, ADD INDEX mauyu\_campaign\_event\_channel (channel, channel\_id), DROP INDEX mauyu\_campaign\_event\_type\_search, ADD INDEX mauyu\_campaign\_event\_search (`type`, event\_type), DROP INDEX mauyu\_event\_type, ADD INDEX mauyu\_campaign\_event\_type (event\_type)’: Can’t DROP ‘mauyu\_campaign\_event\_type\_search’; check that column/key exists [DoctrineDBALExceptionDriverException] An exception occurred while executing ‘ALTER TABLE mauyu\_campaign\_events ADD channel VARCHAR(255) DEFAULT NULL, ADD channel\_id INTEGER DEFAULT NULL, ADD INDEX mauyu\_campaign\_event\_channel (channel, channel\_id), DROP INDEX mauyu\_campaign\_event\_type\_search, ADD INDEX mauyu\_campaign\_event\_search (`type`, event\_type), DROP INDEX mauyu\_event\_type, ADD INDEX mauyu\_campaign\_event\_type (event\_type)’: Can’t DROP ‘mauyu\_campaign\_event\_type\_search’; check that column/key exists [DoctrineDBALDriverMysqliMysqliException] Can’t DROP ‘mauyu\_campaign\_event\_type\_search’; check that column/key exists doctrine:migrations:migrate [–write-sql] [–dry-run] [–query-time] [–allow-no-migration] [–configuration [CONFIGURATION]] [–db-configuration [DB-CONFIGURATION]] [–db DB] [–em EM] [–shard SHARD] [-h|–help] [-q|–quiet] [-v|vv|vvv|–verbose] [-V|–version] [–ansi] [–no-ansi] [-n|–no-interaction] [-s|–shell] [–process-isolation] [-e|–env ENV] [–no-debug] [–] [] [] []

---

<div class="post-metadata">

**Author:** ![waverider](https://avatars.discourse-cdn.com/v4/letter/w/49beb7/32.png) [@waverider](https://forum.mautic.org/u/waverider)\
**Post date:** [March 7, 2017, 7:00am UTC](https://forum.mautic.org/t/database-upgrade-failure/7808/3 "2017-03-07T07:00:50Z")

</div>

Any possibility of help with this? I have tried numerous times to upgrade to both 2.6.1 and 2.7 Each tine the database upgrade fails.  
I have also tried ‘[mysite.com/mautic/s/update/schema](http://mysite.com/mautic/s/update/schema)’ which also fails?

---

<div class="post-metadata">

**Author:** ![bizcrony](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bizcrony/32/409_2.png) [@bizcrony](https://forum.mautic.org/u/bizcrony)\
**Post date:** [March 7, 2017, 3:25pm UTC](https://forum.mautic.org/t/database-upgrade-failure/7808/4 "2017-03-07T15:25:12Z")

</div>

@waverider  
Data base updatation is really a very complicated task in mautic …for that have to do so many things from start …

Better you add me on sk…pe…kishankumawat at live dot com

---

<div class="post-metadata">

**Author:** ![waverider](https://avatars.discourse-cdn.com/v4/letter/w/49beb7/32.png) [@waverider](https://forum.mautic.org/u/waverider)\
**Post date:** [March 9, 2017, 9:30am UTC](https://forum.mautic.org/t/database-upgrade-failure/7808/5 "2017-03-09T09:30:38Z")

</div>

Thanks bizcrony - I have emailed you.

I can’t understand why when trying to update I get the the database error:  
[b]  
Can’t

```auto
DROP 'mauyu_campaign_event_type_search'; 
```

check that column/key exists[/b]

When I dump the sql for the database I get:

* * *

## – – Table structure for table `mauyu_campaign_events`

`CREATE TABLE IF NOT EXISTS `mauyu_campaign_events` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `campaign_id` int(11) NOT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
  `description` longtext COLLATE utf8_unicode_ci,
  `type` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `event_type` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
  `event_order` int(11) NOT NULL,
  `properties` longtext COLLATE utf8_unicode_ci NOT NULL COMMENT '(DC2Type:array)',
  `trigger_date` datetime DEFAULT NULL,
  `trigger_interval` int(11) DEFAULT NULL,
  `trigger_interval_unit` varchar(1) COLLATE utf8_unicode_ci DEFAULT NULL,
  `trigger_mode` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
  `decision_path` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `temp_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `IDX_25BBE925F639F774` (`campaign_id`),
  KEY `IDX_25BBE925727ACA70` (`parent_id`),
  KEY `mauyu_campaign_event_type_search` (`type`,`event_type`),
  KEY `mauyu_event_type` (`event_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
`

* * *

so the key appears to exist but no column?

Not sure how to proceed

Any help appreciated.
