MySQL Forums
Forum List  »  NDB clusters

Add foreign key problem on NDB Cluster
Posted by: Giampaolo Lionello
Date: November 30, 2012 04:34AM

Hi guys!
I have installed MySql Cluster ver. 7.3 but I have problem adding foreign key with error: #150 – Cannot add foreign key constraint

Below my table schema:

CREATE TABLE IF NOT EXISTS `HsProductsPolicy` (
`HsProductsPolicyID` int(11) NOT NULL AUTO_INCREMENT COMMENT ‘ID della policy per i prodotti’,
`Code` varchar(64) COLLATE utf8_unicode_ci NOT NULL COMMENT ‘Codice della policy. Corrisponderà al nome del gruppo di FreeRadius’,
`Notes` text COLLATE utf8_unicode_ci COMMENT ‘Note della policy’,
`ForFreeHotSpots` tinyint(1) NOT NULL DEFAULT ’0′ COMMENT ‘Se True la policy è per prodotti da associare a HotSpots liberi’,
`TrafficBandwidthModulation` int(11) NOT NULL DEFAULT ’0′ COMMENT ‘Abilita la modulazione della velocità in base al traffico. 0 = Non abilitato; 1 = Abilitato medio; ecc.’,
`TrafficBandwidthModulationFromTime` int(11) NOT NULL DEFAULT ’0′ COMMENT ‘Attiva dalle ore’,
`TrafficBandwidthModulationToTime` int(11) NOT NULL DEFAULT ’0′ COMMENT ‘Attiva fino alle ore’,
`TrafficBandwidthModulationHours` int(20) NOT NULL DEFAULT ’0′ COMMENT ‘Periodo di tempo espresso in ore da considerare per l”analisi del traffico effettuato per la modulazione della velocità ’,
`TrafficBandwidthModulationTrafficUp` int(20) NOT NULL DEFAULT ’0′ COMMENT ‘Traffico limite in upload per la modulazione della velocità ’,
`TrafficBandwidthModulationTrafficDown` int(20) NOT NULL DEFAULT ’0′ COMMENT ‘Traffico limite in download per la modulazione della velocità ’,
`BandwidthMinUp` int(20) NOT NULL DEFAULT ’0′ COMMENT ‘Velocità minima di upload’,
`BandwidthMinDown` int(20) NOT NULL DEFAULT ’0′ COMMENT ‘Velocità minima di download’,
`BandwidthMaxDown` int(20) NOT NULL DEFAULT ’0′ COMMENT ‘Velocità massima di download’,
`BandwidthMaxUp` int(20) NOT NULL DEFAULT ’0′ COMMENT ‘Velocità massima di upload’,
PRIMARY KEY (`HsProductsPolicyID`),
KEY `HsProductsPolicyCode` (`Code`)
) ENGINE=NDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPRESSED COMMENT=’Tabella con l”elenco delle policy’ AUTO_INCREMENT=8 ;

CREATE TABLE IF NOT EXISTS `radgroupreply` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`groupname` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT ”,
`attribute` varchar(64) COLLATE utf8_unicode_ci NOT NULL DEFAULT ”,
`op` char(2) COLLATE utf8_unicode_ci NOT NULL DEFAULT ‘=’,
`value` varchar(253) COLLATE utf8_unicode_ci NOT NULL DEFAULT ”,
PRIMARY KEY (`id`),
KEY `GroupName_IDX` (`groupname`)
) ENGINE=NDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=129 ;

ALTER TABLE `radgroupreply`
ADD CONSTRAINT `radgroupreply_ibfk_1` FOREIGN KEY (`groupname`) REFERENCES `HsProductsPolicy` (`Code`) ON DELETE CASCADE ;

Why?

I hope you could help me

Best regards

Options: ReplyQuote


Subject
Views
Written By
Posted
Add foreign key problem on NDB Cluster
2462
November 30, 2012 04:34AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.