
# This is a fix for InnoDB in MySQL >= 4.1.x
# It "suspends judgement" for fkey relationships until are tables are set.
SET FOREIGN_KEY_CHECKS = 0;

#-----------------------------------------------------------------------------
#-- dashboard_media
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `dashboard_media`;


CREATE TABLE `dashboard_media`
(
	`dmid` INTEGER(11)  NOT NULL AUTO_INCREMENT,
	`uid` INTEGER(11)  NOT NULL,
	`created_date` VARCHAR(255),
	`count_view` INTEGER(11),
	`count_comment` INTEGER(11),
	`count_upload` INTEGER(11),
	`created_at` DATETIME  NOT NULL,
	`updated_at` DATETIME  NOT NULL,
	PRIMARY KEY (`dmid`)
)Engine=InnoDB;

#-----------------------------------------------------------------------------
#-- dashboard_user
#-----------------------------------------------------------------------------

DROP TABLE IF EXISTS `dashboard_user`;


CREATE TABLE `dashboard_user`
(
	`duid` INTEGER(11)  NOT NULL AUTO_INCREMENT,
	`uid` INTEGER(11)  NOT NULL,
	`created_date` VARCHAR(255),
	`count_login` INTEGER(11),
	`count_registration` INTEGER(11),
	`created_at` DATETIME  NOT NULL,
	`updated_at` DATETIME  NOT NULL,
	PRIMARY KEY (`duid`)
)Engine=InnoDB;

# This restores the fkey checks, after having unset them earlier
SET FOREIGN_KEY_CHECKS = 1;
