But its giving an error on the datetime fields when using the default currenttimestamp which is allowed in mysql 8 for datetime fields. MySQL Workbench is intended to be a one-stop shop for managing all. enrolled ( id INT UNSIGNED NOT NULL AUTO_INCREMENT, id_customer INT UNSIGNED NOT NULL, id_class INT UNSIGNED NOT NULL, PRIMARY KEY ( id, id_customer, id_class), UNIQUE INDEX id_UNIQUE ( id ASC), UNIQUE INDEX id_customer_UNIQUE ( id_customer ASC), UNIQUE INDEX id_class_UNIQUE ( id_class ASC), INDEX id_class ( id_class ASC), INDEX id_customer ( id_customer ASC), CONSTRAINT id_class FOREIGN KEY ( id_class ) REFERENCES logans. I am trying to create a schema by forward engineering a model eer diagram. Cognizant that not all users are particularly comfortable working from the command. For reference i will attach the model created with MySQL Workbench that shows this behaviour. ![]() Since I am new to foreign key constraints it may be possible that i did something wrong, but then again it should not be possible to create bogus foreign key constraints in a gui application. But I cant figure out what it is as it looks like they are set in a normal way. Unfortunatly nothing helped to solve the problem. ![]() ![]() enrolled-CREATE TABLE IF NOT EXISTS logans. I thought it had something to do with the variables mysql workbench sets when forward engineering. I created the schema in MySQL workbench EER and when I choose Database->Forward Engineer the schema is created apart from one table (enrolled) and I get the following error from the logs.Įxecuting SQL script in serverERROR: Error 1022: Can't write duplicate key in table 'enrolled'- Table logans. Rather new to this but taking a stab at a database for tracking class schedules, lesson location, teacher and students.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |