The todomodel_projects(user,name) you are using is a composite primary key or a joint primary key. If another table wants to reference this composite primary key as an external link key, the field type used must be consistent with the primary key. Take a look at todomodel_tasks. Are the types of the two fields name and todomodel_projects.projects inconsistent, causing a creation error?
In addition, for some common sense about MySQL primary keys and foreign keys, you can simply take a look at http://www.cnblogs.com/web-lover/archive/2012/02/21/2615940.html
The todomodel_projects(user,name) you are using is a composite primary key or a joint primary key. If another table wants to reference this composite primary key as an external link key, the field type used must be consistent with the primary key. Take a look at todomodel_tasks. Are the types of the two fields name and todomodel_projects.projects inconsistent, causing a creation error?
In addition, for some common sense about MySQL primary keys and foreign keys, you can simply take a look at http://www.cnblogs.com/web-lover/archive/2012/02/21/2615940.html