Source

i18d-galleryManager / schema.sql

--
-- Table structure for table `gallery`
--

CREATE TABLE IF NOT EXISTS `gallery` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `versions_data` text NOT NULL,
  `name` tinyint(1) NOT NULL DEFAULT '1',
  `description` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 ;

--
-- Table structure for table `gallery_photo`
--

CREATE TABLE IF NOT EXISTS `gallery_photo` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `gallery_id` int(11) NOT NULL,
  `rank` int(11) NOT NULL DEFAULT '0',
  `file_name` varchar(128) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `fk_gallery_photo_gallery1_idx` (`gallery_id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;

--
-- Table structure for table `gallery_photo_i18n`
--

CREATE TABLE IF NOT EXISTS `gallery_photo_i18n` (
  `id` int(11) NOT NULL,
  `lang` varchar(5) NOT NULL,
  `name` varchar(512) DEFAULT NULL,
  `description` text,
  PRIMARY KEY (`id`,`lang`),
  KEY `fk_gallery_photo_i18n_gallery_photo1_idx` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Constraints for table `gallery_photo`
--
ALTER TABLE `gallery_photo`
  ADD CONSTRAINT `fk_gallery_photo_gallery1` FOREIGN KEY (`gallery_id`) REFERENCES `gallery` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;

--
-- Constraints for table `gallery_photo_i18n`
--
ALTER TABLE `gallery_photo_i18n`
  ADD CONSTRAINT `fk_gallery_photo_i18n_gallery_photo1` FOREIGN KEY (`id`) REFERENCES `gallery_photo` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;