Skip to content

Instantly share code, notes, and snippets.

@doofusdavid
Created October 2, 2015 00:29
Show Gist options
  • Save doofusdavid/99d6e7808406486e4953 to your computer and use it in GitHub Desktop.
Save doofusdavid/99d6e7808406486e4953 to your computer and use it in GitHub Desktop.
test movies page
CREATE TABLE `movies` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`MovieName` varchar(45) DEFAULT NULL,
`Rating` double DEFAULT NULL,
`DateAdded` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
CREATE TABLE `Rating` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Rating` int(11) DEFAULT NULL,
`MovieID` int(11) DEFAULT NULL,
PRIMARY KEY (`ID`),
KEY `fk_Rating_Movie_idx` (`MovieID`),
CONSTRAINT `fk_Rating_Movie` FOREIGN KEY (`MovieID`) REFERENCES `movies` (`ID`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=1000001 DEFAULT CHARSET=latin1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment