[sr-dev] [kamailio/kamailio] Error when upgrading MySQL database schema during v.5.3 to v.5.4 upgrading. (#2424)

leonid-xorcom notifications at github.com
Sun Aug 2 14:10:19 CEST 2020


The recommended My SQL quires for database schema change during Kamailio upgrading from v.5.3 to 5.4 fails:

```
mysql> ALTER TABLE version ADD COLUMN `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT;
ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key
```
The correct command is:
```
mysql> ALTER TABLE `version` ADD COLUMN `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, ADD PRIMARY KEY (`id`);
Query OK, 0 rows affected (0.80 sec)
 ```
In this case the second recommended command 
```
ALTER TABLE version ADD PRIMARY KEY (`id`);
```
 is not needed.

Tested on Ubuntu 18.04, with mysql v.5.7.31
 
Best regards,
Leonid Fainshtein


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2424
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20200802/b92d8479/attachment.htm>


More information about the sr-dev mailing list