What Foreign Key?
Posted by:
John Feist
Date: October 12, 2016 08:39AM
I haven't used MySQL for some time so I am a bit rusty.
We got a set of file dumps from a vendor. Most of them were complete database dumps, so all I had to do was run the scripts and the tables were crated and loaded. One table was not in a script. Rather it had all the data and the top row gave column names.
I went to build the table so that I could load the data. This is the script:
CREATE TABLE `users` (
`id` int(10) unsigned ,
`name` varchar(200),
`company` varchar(200) ,
`email` varchar(200),
`notes` varchar(512),
`active`int(10) unsigned,
`deleted_at` timestamp,
`last_accessed_at` timestamp,
`created_at` timestamp,
`updated_at` timestamp
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;cache_app_user_access_app_id_index
When I went to execute it I got an error 1215 cannot add foreign key constraint. My question is this...where is the foreign key that cannot be added?
Thanks for any assistance you can provide.
John
Subject
Written By
Posted
What Foreign Key?
October 12, 2016 08:39AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.