SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

CREATE TABLE IF NOT EXISTS `reports_formats` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `format` varchar(32) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;


INSERT INTO `reports_formats` (`id`, `format`) VALUES
(1, 'xml'),
(2, 'plain'),
(3, 'premorph');


ALTER TABLE  `reports` ADD  `format_id` INT NOT NULL DEFAULT  '1';
ALTER TABLE  `reports` ADD INDEX (  `format_id` ) ;

ALTER TABLE  `reports` ADD FOREIGN KEY (  `format_id` ) REFERENCES  `inforex`.`reports_formats` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT ;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;


