
#-----------------------------------------------------------------------------
#-- content_image
#-----------------------------------------------------------------------------



CREATE TABLE `content_image`
(
	`id` INTEGER  NOT NULL AUTO_INCREMENT,
	`hierarchy_id` INTEGER  NOT NULL,
	PRIMARY KEY (`id`),
	INDEX `content_image_FI_1` (`hierarchy_id`),
	CONSTRAINT `content_image_FK_1`
		FOREIGN KEY (`hierarchy_id`)
		REFERENCES `hierarchy` (`id`)
		ON UPDATE RESTRICT
		ON DELETE RESTRICT
);

#-----------------------------------------------------------------------------
#-- content_image_i18n
#-----------------------------------------------------------------------------



CREATE TABLE `content_image_i18n`
(
	`id` INTEGER  NOT NULL,
	`culture` VARCHAR(7)  NOT NULL,
	`url` VARCHAR(256),
	`title` TEXT  NOT NULL,
	`subtitle` TEXT  NOT NULL,
	`image` VARCHAR(256)  NOT NULL,
	PRIMARY KEY (`id`,`culture`),
	CONSTRAINT `content_image_i18n_FK_1`
		FOREIGN KEY (`id`)
		REFERENCES `content_image` (`id`)
		ON UPDATE RESTRICT
		ON DELETE CASCADE
);

#-----------------------------------------------------------------------------
#-- content_widget
#-----------------------------------------------------------------------------



CREATE TABLE `content_widget`
(
	`id` INTEGER  NOT NULL AUTO_INCREMENT,
	PRIMARY KEY (`id`)
);

#-----------------------------------------------------------------------------
#-- content_widget_i18n
#-----------------------------------------------------------------------------



CREATE TABLE `content_widget_i18n`
(
	`id` INTEGER  NOT NULL,
	`culture` VARCHAR(7)  NOT NULL,
	`title` VARCHAR(256)  NOT NULL,
	`content` TEXT  NOT NULL,
	`displayed` INTEGER default 0,
	`altert` INTEGER default 0,
	PRIMARY KEY (`id`,`culture`),
	CONSTRAINT `content_widget_i18n_FK_1`
		FOREIGN KEY (`id`)
		REFERENCES `content_widget` (`id`)
		ON UPDATE RESTRICT
		ON DELETE CASCADE
);