You should be able to pull the ID of the parent table in when you do the
INSERT ... SELECT to pull the data in, in which case, the IDs in the foreign
key fields would still be valid.
I'd convert them all to MyISAM rather than doing half and half.
----- Original Message -----
From: "Scott Purcell" <[EMAIL PROTECTED]>
To: <mysql@lists.mysql.com>
Sent: Wednesday, May 25, 2005 6:22 AM
Subject: Alter InnoDB to MyISAM Part2
I can do this programatically, and will alter the table. But there are three
tables that have foreign key references to the table I will be altering.
They look like this.
CREATE TABLE ITEM_CAT_REL (
id INT,
cat_id INT NOT NULL,
key(id),
FOREIGN KEY (id) references ITEM(id) on DELETE CASCADE
) TYPE=InnoDB;
INSERT INTO ITEM_CAT_REL (id, cat_id) values (5000, 5);
INSERT INTO ITEM_CAT_REL (id, cat_id) values (5000, 6);
How do I handle these three tables? Do I need to remove the foreign key
somehow? These tables do not need fulltext search, so should I leave them as
an InnoDB, or convert to MyISAM?
Thanks,
Scott
###
- ALTER TABLE table_name TYPE=MyISAM;
- and no, you can't have foreign keys with MyISAM tables--or rather,
there's nothing preventing you using foreign keys but you will have to
enforce referential integrity programmatically. MySQL won't do it for you.
- ian
#####
http://dev.mysql.com/doc/mysql/en/converting-tables-to-innodb.html
key relationships?
MyISAM can't FK's.
Regards,
Rafal
Thanks,
Scott
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]