[RESOLVED] Will this method give me any Problems
Hi Guys,
I have an existing MySQL 3 database. I want to create a new one with the same tables in MySQL 5. I have extracted all the create table statements. Take this one for example:
Code:
DROP TABLE IF EXISTS `terms`;
CREATE TABLE `terms` (
`TermID` int(11) NOT NULL auto_increment,
`Year` int(11) default '0',
`Quarter` int(11) default '0',
`Starts` varchar(10) default NULL,
`Ends` varchar(10) default NULL,
`Seq` int(11) NOT NULL default '0',
PRIMARY KEY (`TermID`),
KEY `TermID` (`TermID`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
and I have changed Engine = MyISAM to Engine = InnoDb as follows:
Code:
DROP TABLE IF EXISTS `terms`;
CREATE TABLE `terms` (
`TermID` int(11) NOT NULL auto_increment,
`Year` int(11) default '0',
`Quarter` int(11) default '0',
`Starts` varchar(10) default NULL,
`Ends` varchar(10) default NULL,
`Seq` int(11) NOT NULL default '0',
PRIMARY KEY (`TermID`),
KEY `TermID` (`TermID`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
Is this a valid method or will I have problems
Re: Will this method give me any Problems
Yes, that is fine.
On a side note, InnoDB type of engine focuses on Relational Data Integrity. In order to gain any advantage from the engine switching (MyISAM -> InnoDB), you have to add Foreign Keys to your scheme.
HoraShadow
Re: Will this method give me any Problems
Thanks a lot HoraShadow,
I will look into the foreign keys.:wave: