Hi!
I tried to create this table: (db.py)
db.define_table('navbar', Field("title", "string"), Field("url", "string", requires=IS_EMPTY_OR(IS_URL())), Field("cont", label="Controller"), Field("func", label="Function"), Field("args", label="Arguments"), Field("sortable", "integer"), Field("parent_id", "reference navbar"), format="%(title)s", )
sql generated:
CREATE TABLE navbar_admin( id INT AUTO_INCREMENT NOT NULL, title VARCHAR(512), url VARCHAR(512), cont VARCHAR(512), func VARCHAR(512), args VARCHAR(512), sortable INT, parent_id INT, INDEX parent_id__idx (parent_id), FOREIGN KEY (parent_id) REFERENCES navbar (id) ON DELETE CASCADE, PRIMARY KEY(id) ) ENGINE=InnoDB CHARACTER SET utf8; faked!mysql error: Cannot add foreign key constraint
any solution?
Answers (0)
Comments (0)