Commits

Bogdan Savluk  committed 4627545

Update database schema.

  • Participants
  • Parent commits 3b246e8

Comments (0)

Files changed (1)

+--
+-- Table structure for table `gallery`
+--
 
--- -----------------------------------------------------
--- Table `gallery`
--- -----------------------------------------------------
-CREATE  TABLE IF NOT EXISTS `gallery` (
-  `id` INT 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;
+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`
+--
 
--- -----------------------------------------------------
--- Table `gallery_photo`
--- -----------------------------------------------------
-CREATE  TABLE IF NOT EXISTS `gallery_photo` (
-  `id` INT NOT NULL AUTO_INCREMENT ,
-  `gallery_id` INT NOT NULL ,
-  `rank` INT NOT NULL DEFAULT 0 ,
-  `name` VARCHAR(512) NOT NULL ,
-  `description` TEXT NOT NULL ,
-  `file_name` VARCHAR(128) NOT NULL ,
-  PRIMARY KEY (`id`) ,
-  INDEX `fk_gallery_photo_gallery1` (`gallery_id` ASC) ,
-  CONSTRAINT `fk_gallery_photo_gallery1`
-    FOREIGN KEY (`gallery_id` )
-    REFERENCES `gallery` (`id` )
-    ON DELETE NO ACTION
-    ON UPDATE NO ACTION)
-ENGINE = InnoDB;
+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;
+