Yii Framework Forum: Yiiscrapermodule Database Error (Assumed Foreign Key Error)? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Yiiscrapermodule Database Error (Assumed Foreign Key Error)? CDbCommand SQLSTATE[HY000]: (errno: 150) Rate Topic: -----

#1 User is offline   vyywern 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 02-June 13

Posted 03 June 2013 - 04:56 AM

Here is the sql statement that was supposed to be run, somehow the tables were created but it gets stuck at the foriegn key part im guessing? because i checked the error code and it says something about the table's data types/ columns mismatch.. can anyone help me figure out what was wrong with it?

SQL statement executed was: CREATE TABLE `yiiscraper_related_data` (
`link_id_from` int(11) unsigned NOT NULL,
`link_id_to` int(11) unsigned NOT NULL,
PRIMARY KEY (`link_id_from`,`link_id_to`),
UNIQUE KEY `link_id_to` (`link_id_to`,`link_id_from`),
CONSTRAINT `tbl_yiiscraper_related_data_ibfk_1` FOREIGN KEY (`link_id_from`) REFERENCES `tbl_yiiscraper_link` (`id`) ON DELETE CASCADE,
CONSTRAINT `tbl_yiiscraper_related_data_ibfk_2` FOREIGN KEY (`link_id_to`) REFERENCES `tbl_yiiscraper_link` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Table to handle relations of links'
0

#2 User is offline   windsurfer 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 11-April 12

Posted 10 October 2013 - 07:26 AM

I'm also getting similar error on install below. Anyone have any ideas?


CDbException

CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1005 Can't create table 'yii_rk_instafire.yiiscraper_related_data' (errno: 150). The SQL statement executed was: CREATE TABLE `yiiscraper_related_data` (
`link_id_from` int(11) unsigned NOT NULL,
`link_id_to` int(11) unsigned NOT NULL,
PRIMARY KEY (`link_id_from`,`link_id_to`),
UNIQUE KEY `link_id_to` (`link_id_to`,`link_id_from`),
CONSTRAINT `tbl_yiiscraper_related_data_ibfk_1` FOREIGN KEY (`link_id_from`) REFERENCES `tbl_yiiscraper_link` (`id`) ON DELETE CASCADE,
CONSTRAINT `tbl_yiiscraper_related_data_ibfk_2` FOREIGN KEY (`link_id_to`) REFERENCES `tbl_yiiscraper_link` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Table to handle relations of links'
0

#3 User is offline   windsurfer 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 11-April 12

Posted 10 October 2013 - 07:34 AM

Okay, here is the solution near the bottom of the extension page: http://www.yiiframew...iscrapermodule/

And it does work. I reran the install and got this message, "itOK: installed"
And now that table is in my database :D

aquasite.pl at 2013/01/15 05:46am
Install Error
Hi, Thanks for extension. You forgot to add prefix in Installer sql query on line 55 and 56.

It's: tbl_yiiscraper_link Should be: {$prefix}yiiscraper_link
0

#4 User is offline   Da:Sourcerer 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,162
  • Joined: 30-March 11
  • Location:Berlin, Germany

Posted 10 October 2013 - 07:38 AM

Well, let's check the obvious:
  • Does the table tbl_yiiscraper_link really exist?
  • Is the field tbl_yiiscraper_link.id exactly of the type int(11) unsigned NOT NULL?

Also: http://stackoverflow...8070336/3012385

Edit: Ah, there you go ::)
programmer /ˈprəʊgramə/, noun: a device that converts ►coffee into ►code
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users