我有一个mapper方法来删除表中的所有记录。但首先,我需要删除关联连接表中的所有记录。Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to us
create table foo (id auto increment primary key, name varchar(255))
我写了一个简单的rails迁移脚本,它在self.up上创建一个新记录如果我执行db:migrate,它会用id=1创建一个新条目,如果我回滚,它会被删除。如果我再次迁移/删除,因为使用主键id=2创建了记录,并且我的删除脚本在回滚时失败,就会出现问题。