привет всем
стало мало типа INT в первичном ключе, решил поменять:
имеем: Percona Server (GPL), Release 38.13, Revision 812705b
mysql> select @
@version;
+--------------+
| @
@version |
+--------------+
| 5.5.61-38.13 |
+--------------+
1 row in set (0.00 sec)
mysql> SET FOREIGN_KEY_CHECKS=0;
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT @
@FOREIGN_KEY_CHECKS;
+----------------------+
| @
@FOREIGN_KEY_CHECKS |
+----------------------+
| 0 |
+----------------------+
1 row in set (0.00 sec)
mysql> ALTER TABLE table1 MODIFY id BIGINT NOT NULL AUTO_INCREMENT;
ERROR 1025 (HY000): Error on rename of './/#sql-1_fa' to './/table1' (errno: 150)
mysql> SHOW ENGINE INNODB STATUS;
------------------------
LATEST FOREIGN KEY ERROR
------------------------
200527 18:29:19 Error in foreign key constraint of table /table2:
there is no index in referenced table which would contain
the columns as the first columns, or the data types in the
referenced table do not match the ones in table. Constraint:
,
CONSTRAINT "FK_36FD80564C3A3BB" FOREIGN KEY ("table1_id") REFERENCES "table1" ("id")
The index in the foreign key in table is "UNIQ_36FD80564C3A3BB"
See
http://dev.mysql.com/doc/refman/5.5/en/innodb-foreign-key-constraints.htmlfor correct foreign key definition.
--------
1. можно както без отключения внешних ключей сменить тип?
2. почему отключение внешних ключей не срабатывает?