MySQL Lists are EOL. Please join:

List:General Discussion« Previous MessageNext Message »
From:Nico Rittner Date:April 24 2006 1:11pm
Subject:Re: mysqldump and foreign keys
View as plain text  
hi,

> are you using the InnoDB storage engine for your tables?
yes, i do.

example:

$ mysqldump -d core groups :

CREATE TABLE `groups` (
`id` smallint(5) unsigned NOT NULL default '0',
`name` varchar(32) NOT NULL default '',
`parent_id` smallint(5) unsigned default NULL,
`setting_` text NOT NULL,
`r__groups_users_status__id` tinyint(3) unsigned NOT NULL default '0',
`_ctime` int(10) unsigned NOT NULL default '0',
`_mtime` int(10) unsigned NOT NULL default '0',
`_uid` smallint(5) unsigned NOT NULL default '0',
`_gid` smallint(5) unsigned NOT NULL default '0',
`_mod` smallint(5) unsigned NOT NULL default '0',
PRIMARY KEY  (`id`),
KEY `_uid` (`_uid`),
KEY `_gid` (`_gid`),
KEY `_mod` (`_mod`),
KEY `parent_id` (`parent_id`),
KEY `r__groups_users_status__id` (`r__groups_users_status__id`),
CONSTRAINT `groups_ibfk_10` FOREIGN KEY (`_gid`) REFERENCES `groups` (`id`),
CONSTRAINT `groups_ibfk_11` FOREIGN KEY (`_uid`) REFERENCES `users` (`id`),
CONSTRAINT `groups_ibfk_7` FOREIGN KEY (`parent_id`) REFERENCES `groups` (`id`),
CONSTRAINT `groups_ibfk_8` FOREIGN KEY (`r__groups_users_status__id`) REFERENCES
`groups_users_status` (`id`),
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='groups';

As you can see, the foreign keys - statements are included,
but without the 'action parts' ( on update,on delete );

thanks,

Nico
Thread
mysqldump and foreign keysNico Rittner23 Apr
  • Re: mysqldump and foreign keysFrank24 Apr
    • Re: mysqldump and foreign keysNico Rittner24 Apr
  • Re: mysqldump and foreign keysFrank25 Apr
    • Re: mysqldump and foreign keysNico Rittner25 Apr
  • Re: mysqldump and foreign keysFrank26 Apr
    • Re: mysqldump and foreign keysNico Rittner26 Apr
  • Re: mysqldump and foreign keysFrank27 Apr