   CONSTRAINT `ItemModification_ibfk_3` FOREIGN KEY (`ItemID`) REFERENCES `Item` (`ItemID`) ON DELETE NO ACTION ON UPDATE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 
-
-CREATE TABLE `ItemStatus` (
-  `StatusID` int(11) NOT NULL AUTO_INCREMENT,
-  `StatusText` text NOT NULL,
-  PRIMARY KEY (`StatusID`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-
-
-CREATE TABLE `ItemType` (
-  `TypeID` int(11) NOT NULL AUTO_INCREMENT,
-  `TypeText` text NOT NULL,
-  PRIMARY KEY (`TypeID`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-
-
 CREATE TABLE `Modification` (
   `ModificationID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
   `UserID` bigint(20) unsigned NOT NULL,
-  `Date` datetime NOT NULL,
+  `Date` bigint(20) unsigned NOT NULL,
   `Notes` text COLLATE utf8mb4_unicode_ci,
   PRIMARY KEY (`ModificationID`),
   KEY `UserID` (`UserID`),

	`ValueText` text DEFAULT NULL,
  PRIMARY KEY (`FeatureID`,`ItemID`),
  KEY `ItemID` (`ItemID`),
  CONSTRAINT `ItemFeature_ibfk_1` FOREIGN KEY (`ItemID`) REFERENCES `Item` (`ItemID`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `ItemFeature_ibfk_3` FOREIGN KEY (`FeatureID`) REFERENCES `Feature` (`FeatureID`) ON DELETE NO ACTION ON UPDATE CASCADE,
	CHECK((`Value` IS NOT NULL AND `ValueText` IS NULL)
  OR (`Value` IS NULL AND `ValueText` IS NOT NULL))


SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';

DROP DATABASE IF EXISTS `tarallo`;
CREATE DATABASE `tarallo` DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
USE `tarallo`;

