Hello.


Use InnoDB tables instead of MyISAM. See:

  http://dev.mysql.com/doc/mysql/en/ansi-diff-foreign-keys.html









"Philipp Snizek" <[EMAIL PROTECTED]> wrote:

> Hi

> 

> I run a Postfix MTA attached to a mysql DB with various domains on it.

> A domain consists of email addresses.

> When I want to delete the domain the referenced email addresses should

> be deleted, too. But that doesn't work and I don't know why.

> 

> here are the two tables domains and users:

> 

> CREATE TABLE domains (

>  ID_DOMAINS int(11) auto_increment,

>  active int(1) not null,

>  domain varchar(50) NOT NULL,

>  PRIMARY KEY (ID_DOMAINS)

> ) TYPE=3DMyISAM;

> 

> create table users (

> email varchar (80) primary key unique not null, belongs_to integer not

> null, foreign key (belongs_to) references domains on delete cascade );

> 

> if I use the delete command like "delete from domains where

> id_domains=3D'1'" the dataset that belongs to id 1 in domains is deleted

> while the email addresses belonging to this domain are left untouched.

> 

> What am I missing?

> 

> thanks

> Philipp

> 



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.NET http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Gleb Paharenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.NET
       <___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to