-- Convert schema './FileFormats-Schema-0.02-MySQL.sql' to './FileFormats-Schema-0.03-MySQL.sql':

BEGIN;

SET foreign_key_checks=0;


CREATE TABLE systems (
  id integer(11) NOT NULL auto_increment,
  name varchar(255) NOT NULL,
  comments text NOT NULL,
  PRIMARY KEY (id)
) ENGINE=InnoDB;


SET foreign_key_checks=1;


ALTER TABLE types DROP COLUMN system,
                  ADD COLUMN system_id integer(11) NOT NULL,
                  ADD COLUMN comments text NOT NULL,
                  ADD INDEX  (system_id),
                  ADD CONSTRAINT fk_system_id FOREIGN KEY (system_id) REFERENCES systems (id) ON DELETE CASCADE ON UPDATE CASCADE;

COMMIT;
