can you try changing db.bookpage to "reference bookpage"
Em 24/08/2012 13:01, "Niphlod" <[email protected]> escreveu:
> There is something else going on. This is the log (no errors creating
> tables) of the following model on mysql 5.5. web2py trunk (but at least on
> table creation nothing should have changed since 1.99.7)
>
> db.define_table('book',
> Field('bookname')
> )
>
> db.define_table('bookpage',
> Field('content', 'text'),
> Field('image', 'upload'),
> Field('from_book', db.book),
> Field('modified_on', 'datetime', default=request.now))
>
> db.bookpage.content.requires = IS_NOT_EMPTY()
> db.bookpage.from_book.requires = IS_NOT_EMPTY()
> db.bookpage.modified_on.writable = False
>
> db.define_table('page_link',
> Field('in_page', db.bookpage),
> Field('out_page', db.bookpage),
> Field('the_text'))
>
>
>
>
> timestamp: 2012-08-24T17:58:04.909000
> CREATE TABLE book(
> id INT AUTO_INCREMENT NOT NULL,
> bookname VARCHAR(255),
> PRIMARY KEY(id)
> ) ENGINE=InnoDB CHARACTER SET utf8;
> success!
> timestamp: 2012-08-24T17:58:04.937000
> CREATE TABLE bookpage(
> id INT AUTO_INCREMENT NOT NULL,
> content LONGTEXT,
> image VARCHAR(255),
> from_book INT, INDEX from_book__idx (from_book), FOREIGN KEY (
> from_book) REFERENCES book (id) ON DELETE CASCADE,
> modified_on DATETIME,
> PRIMARY KEY(id)
> ) ENGINE=InnoDB CHARACTER SET utf8;
> success!
> timestamp: 2012-08-24T17:58:04.959000
> CREATE TABLE page_link(
> id INT AUTO_INCREMENT NOT NULL,
> in_page INT, INDEX in_page__idx (in_page), FOREIGN KEY
> (in_page)REFERENCES bookpage
> (id) ON DELETE CASCADE,
> out_page INT, INDEX out_page__idx (out_page), FOREIGN KEY
> (out_page)REFERENCES bookpage
> (id) ON DELETE CASCADE,
> the_text VARCHAR(255),
> PRIMARY KEY(id)
> ) ENGINE=InnoDB CHARACTER SET utf8;
> success!
>
>
>
>
> --
>
>
>
>
--