Note that there are some explanatory texts on larger screens.

plurals
  1. POInnoDB error with create table
    primarykey
    data
    text
    <p>Have someone idea, why this SQL return error on create table accounts?</p> <h1>1005 - Can't create table 'mobilewaiter.accounts' (errno: 150)</h1> <p>I saw, that problem can be with index on keys, but everything refer on primary key. Help me, thanks.</p> <pre><code>CREATE TABLE IF NOT EXISTS `tables` ( `_id` int(10) NOT NULL AUTO_INCREMENT, `tag` varchar(40) COLLATE utf8_czech_ci NOT NULL, `name` varchar(40) COLLATE utf8_czech_ci NOT NULL, `occupied` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS `users` ( `_id` int(10) NOT NULL AUTO_INCREMENT, `nick` varchar(20) COLLATE utf8_czech_ci NOT NULL, `password` varchar(40) COLLATE utf8_czech_ci NOT NULL, `salt` varchar(20) COLLATE utf8_czech_ci NOT NULL, `email` varchar(50) COLLATE utf8_czech_ci NOT NULL, `firstname` varchar(20) COLLATE utf8_czech_ci NOT NULL, `lastname` varchar(20) COLLATE utf8_czech_ci NOT NULL, `role` varchar(20) COLLATE utf8_czech_ci NOT NULL, PRIMARY KEY (`_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS `accounts` ( `_id` int(10) NOT NULL AUTO_INCREMENT, `table_id` varchar(10) COLLATE utf8_czech_ci NOT NULL, `state` varchar(20) COLLATE utf8_czech_ci NOT NULL DEFAULT 'created', `user_id` int(10) NOT NULL, `start_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `end_time` timestamp NULL DEFAULT NULL, PRIMARY KEY (`_id`), FOREIGN KEY (`table_id`) REFERENCES `tables`(`_id`) ON DELETE CASCADE ON UPDATE CASCADE, FOREIGN KEY (`user_id`) REFERENCES `users`(`_id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=1 ; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload