I am a complete beginner with MySQl. I used wwwsqldesigner to make a schema of my database. I'd like to put the script inside PHPmyAdmin but it always throws me an error, and it is in the beginning of the generated script from wwwsqldesigner. I just copied the first part of the query
CREATE TABLE `ugl_users_events` (
`id` INTEGER NOT NULL AUTO_INCREMENT DEFAULT NULL,
`user_id` INTEGER NULL DEFAULT NULL,
`event_id` INTEGER NULL DEFAULT NULL,
`game_id` INTEGER NULL DEFAULT NULL,
`creator` INTEGER NULL DEFAULT NULL,
`creation_date` DATETIME NULL DEFAULT NULL,
`last_modificator` INTEGER NULL DEFAULT NULL,
`last_modification_date` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY ()
);
Where is the error ?
You have a useless empty unique key
clause. Remove it and you should be OK.
CREATE TABLE `ugl_users_events` (
`id` INTEGER NOT NULL AUTO_INCREMENT DEFAULT NULL,
`user_id` INTEGER NULL DEFAULT NULL,
`event_id` INTEGER NULL DEFAULT NULL,
`game_id` INTEGER NULL DEFAULT NULL,
`creator` INTEGER NULL DEFAULT NULL,
`creation_date` DATETIME NULL DEFAULT NULL,
`last_modificator` INTEGER NULL DEFAULT NULL,
`last_modification_date` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`)
-- clause removed, together with the comma before it
);