Skip to content

Instantly share code, notes, and snippets.

@DTSCode
Last active August 29, 2015 14:18
Show Gist options
  • Save DTSCode/23a5f0ae3833d63f7632 to your computer and use it in GitHub Desktop.
Save DTSCode/23a5f0ae3833d63f7632 to your computer and use it in GitHub Desktop.
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,
CONSTRAINT `fk_sayer_id`
FOREIGN KEY (sayer_id) REFERENCES Nicks (id)
ON DELETE CASCADE
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment