I've been searching for a conversion tool or a list of things to change when switching from mySQL to SQLite. However, the conversion tools are, as far as I found, converting an already existing mySQL database to a SQLite database.
I don't have the made the mySQL database yet, I only have the create statements. So is there either a list of changes to make to the create statements, or a converter that changes the mySQL create statements to SQLite create statements?
My sql looks like this:
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';
CREATE SCHEMA IF NOT EXISTS `pyMS` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ;
USE `pyMS` ;
-- -----------------------------------------------------
-- Table `pyMS`.`msrun`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `pyMS`.`msrun` (
`msrun_id` INT NOT NULL ,
`description` VARCHAR(250) NOT NULL ,
PRIMARY KEY (`msrun_id`) )
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `pyMS`.`feature`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `pyMS`.`feature` (
`feature_id` VARCHAR(40) NOT NULL ,
`intensity` DOUBLE NOT NULL ,
`overallquality` DOUBLE NOT NULL ,
`quality` DOUBLE NOT NULL ,
`charge` INT NOT NULL ,
`content` VARCHAR(45) NOT NULL ,
`msrun_msrun_id` INT NOT NULL ,
PRIMARY KEY (`feature_id`, `msrun_msrun_id`) ,
UNIQUE INDEX `id_UNIQUE` (`feature_id` ASC) ,
INDEX `fk_feature_msrun1` (`msrun_msrun_id` ASC) ,
CONSTRAINT `fk_feature_msrun1`
FOREIGN KEY (`msrun_msrun_id` )
REFERENCES `pyMS`.`msrun` (`msrun_id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
[...]
I dont think you will find a list of changes like "replace A with B". What you can do is look what these migration scripts do and come up with your own list.
For example, take the one on this link
if you get commands like sed 's/ smallint([0-9]*) / integer /g' |
you can see what's being done (sed is a string replacement unix command).
Its just a matter of going through the scripts.