Skip to content

Instantly share code, notes, and snippets.

@DTSCode
DTSCode / tables
Last active August 29, 2015 14:18
CREATE TABLE Nicks ( id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, nick VARCHAR(200) NOT NULL);
CREATE TABLE Quote (
id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
grabber_id MEDIUMINT UNSIGNED NOT NULL,
sayer_id MEDIUMINT UNSIGNED NOT NULL,
quote VARCHAR(1500) NOT NULL,
CONSTRAINT `fk_grabber_id`
FOREIGN KEY (grabber_id) REFERENCES Nicks (id)
ON DELETE CASCADE,