internetprogrammierung/sql/entiresTable.sql

33 lines
1.2 KiB
SQL

CREATE TABLE `kd42696_ipr-projekt`.`entries` (
`id` INT NOT NULL AUTO_INCREMENT ,
`userID` INT NOT NULL ,
`tanID` INT NOT NULL ,
`vorname` LONGTEXT NOT NULL ,
`nachname` LONGTEXT NOT NULL ,
`geburtstag` LONGTEXT DEFAULT NULL ,
`wohnort` LONGTEXT DEFAULT NULL ,
`strasse` LONGTEXT DEFAULT NULL ,
`kennenUns` LONGTEXT NOT NULL ,
`festnetz` LONGTEXT DEFAULT NULL ,
`handynummer` LONGTEXT DEFAULT NULL ,
`email` LONGTEXT NOT NULL ,
`hobbies` LONGTEXT DEFAULT NULL ,
`berufswunsch` LONGTEXT DEFAULT NULL ,
`essen` LONGTEXT DEFAULT NULL ,
`insel` LONGTEXT DEFAULT NULL ,
`film` LONGTEXT DEFAULT NULL ,
`sport` LONGTEXT DEFAULT NULL ,
`charakter` LONGTEXT DEFAULT NULL ,
`tier` LONGTEXT DEFAULT NULL ,
`musik` LONGTEXT DEFAULT NULL ,
`game` LONGTEXT DEFAULT NULL ,
`alk` LONGTEXT DEFAULT NULL ,
`story` LONGTEXT DEFAULT NULL ,
`absturz` LONGTEXT DEFAULT NULL ,
`trinkspiel` LONGTEXT DEFAULT NULL ,
PRIMARY KEY (`id`),
UNIQUE (`tanID`)) ENGINE = InnoDB;
ALTER TABLE `entries` ADD FOREIGN KEY (`userID`) REFERENCES `user`(`ID`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `entries` ADD FOREIGN KEY (`tanID`) REFERENCES `tans`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;