Login | Register
My pages Projects Community openCollabNet

Discussions > users > [propel] MySQL bombing (what's with all the bombing?)

propel
Discussion topic

Hide all messages in topic

All messages in topic

[propel] MySQL bombing (what's with all the bombing?)

Reply

Author "Denny H dot Shimkoski" <dhs at hamfish dot org>
Full name "Denny H dot Shimkoski" <dhs at hamfish dot org>
Date 2004-04-12 12:13:54 PDT
Message Thanks for the previous reply, Hans.

OK.... not a typo this time. :)

ERROR 1005 at line 34: Can't create table '.\testing\user_role_ref.frm'
(errno: 150)

I looked this up on the net and according to a man smarter than myself
this means either:

* No index has been defined on the column other_id
* The referenced table is not an InnoDB table
* The referenced column is not unique

But, as you can see, the generated tables define the
unique index known as a primary key on the InnoDB tables --

#
--------------------​--------------------​--------------------​-----------
# user
#
--------------------​--------------------​--------------------​-----------
drop table if exists user;

CREATE TABLE user(
 
    user_id INTEGER NOT NULL AUTO_INCREMENT,
 
    username VARCHAR(50) NOT NULL ,
 
    password VARCHAR(32) NOT NULL ,
 
    email VARCHAR(100) ,
    
    PRIMARY KEY(user_id)) Type=InnoDB;
#
--------------------​--------------------​--------------------​-----------
# role
#
--------------------​--------------------​--------------------​-----------
drop table if exists role;

CREATE TABLE role(
 
    role_id INTEGER NOT NULL AUTO_INCREMENT,
 
    name VARCHAR(50) NOT NULL ,
    
    PRIMARY KEY(role_id)) Type=InnoDB;
#
--------------------​--------------------​--------------------​-----------
# user_role_ref
#
--------------------​--------------------​--------------------​-----------
drop table if exists user_role_ref;

CREATE TABLE user_role_ref(
 
    user_id INTEGER NOT NULL ,
 
    role_id INTEGER NOT NULL ,
    
    PRIMARY KEY(user_id,role_id),
    FOREIGN KEY (user_id) REFERENCES user (user_id),
    FOREIGN KEY (role_id) REFERENCES role (role_id)) Type=InnoDB;


...so what's the beef?

Thanks again!
Denny

Temet Nosce -- http://mysticweb.org/

--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: users-unsubscribe@pr​opel.tigris.org
For additional commands, e-mail: users-help at propel dot tigris dot org
Messages per page: