-
-
Save gabidavila/8496c877fdbfbe8b24740bc4c2126a29 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Table structure for table `users` | |
-- | |
CREATE TABLE `users` ( | |
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, | |
`name` VARCHAR(255) DEFAULT NULL, | |
`email` VARCHAR(255) DEFAULT NULL, | |
`country` CHAR(2) DEFAULT NULL, | |
`created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
PRIMARY KEY (`id`) | |
) | |
ENGINE = InnoDB; | |
-- | |
-- Table structure for table `comments` | |
-- | |
CREATE TABLE `comments` ( | |
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT, | |
`user_id` INT(11) UNSIGNED NOT NULL, | |
`post_id` INT(11) DEFAULT NULL, | |
`message` TEXT, | |
`created` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP, | |
PRIMARY KEY (`id`), | |
KEY `fk_comments_user_id` (`user_id`), | |
CONSTRAINT `fk_comments_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) | |
) | |
ENGINE = InnoDB; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment