Quantcast
Channel: MySQL Forums - NDB clusters
Viewing all articles
Browse latest Browse all 1562

Add foreign key problem on NDB Cluster (no replies)

$
0
0
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

Viewing all articles
Browse latest Browse all 1562

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>