-- CREATE TABLE "smd__activity" ---------------------------------
CREATE TABLE `smd__activity` (
	`activityID` Int( 10 ) UNSIGNED AUTO_INCREMENT NOT NULL,
	`userID` Int( 10 ) UNSIGNED NOT NULL,
	`objectType` VarChar( 45 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
	`objectID` Int( 10 ) UNSIGNED NOT NULL,
	`summary` VarChar( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NULL,
	`activityDate` DateTime NOT NULL,
	PRIMARY KEY ( `activityID` ) )
CHARACTER SET = utf8
COLLATE = utf8_general_ci
COMMENT 'tevekenysegi tortenet'
ENGINE = InnoDB;
-- -------------------------------------------------------------

-- CREATE INDEX "activityDate" ---------------------------------
CREATE INDEX `activityDate` USING BTREE ON `smd__activity`( `activityDate` );
-- -------------------------------------------------------------
-- -------------------------------------------------------------

-- CREATE INDEX "fk_smd__activity_cms__user1" -------------------
CREATE INDEX `fk_smd__activity_cms__user1` USING BTREE ON `smd__activity`( `userID` );
-- -------------------------------------------------------------

-- CREATE INDEX "objectID" -------------------------------------
CREATE INDEX `objectID` USING BTREE ON `smd__activity`( `objectID` );
-- -------------------------------------------------------------

-- CREATE INDEX "objectType" -----------------------------------
CREATE INDEX `objectType` USING BTREE ON `smd__activity`( `objectType` );
-- -------------------------------------------------------------

-- CREATE LINK "smd__activity_ibfk_2" ---------------------------
ALTER TABLE `smd__activity`
	ADD CONSTRAINT `pn__activity_ibfk_2` FOREIGN KEY ( `userID` )
	REFERENCES `cms__user`( `userID` )
	ON DELETE Cascade
	ON UPDATE Cascade;
-- -------------------------------------------------------------
