Results 1 to 3 of 3

Thread: [RESOLVED] Will this method give me any Problems

  1. #1

    Thread Starter
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    Resolved [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

  2. #2
    Fanatic Member
    Join Date
    May 2005
    Posts
    608

    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
    I do like the reward system. If you find that my post was useful, rate it.

  3. #3

    Thread Starter
    PowerPoster Nitesh's Avatar
    Join Date
    Mar 2007
    Location
    Death Valley
    Posts
    2,556

    Re: Will this method give me any Problems

    Thanks a lot HoraShadow,

    I will look into the foreign keys.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width