Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - --------------------------------------------------------
- --
- -- Structure de la table `messages`
- --
- CREATE TABLE IF NOT EXISTS `messages` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `id_parent` int(10) unsigned DEFAULT NULL,
- `id_sender` int(10) unsigned NOT NULL,
- `id_receiver` int(10) unsigned NOT NULL,
- `content` varchar(140) NOT NULL,
- `date` datetime NOT NULL,
- PRIMARY KEY (`id`),
- KEY `id_parent` (`id_parent`),
- KEY `id_sender` (`id_sender`),
- KEY `id_receiver` (`id_receiver`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ;
- --
- -- Contenu de la table `messages`
- --
- INSERT INTO `messages` (`id`, `id_parent`, `id_sender`, `id_receiver`, `content`, `date`) VALUES
- (1, NULL, 1, 2, 'All this bitchies wanna lick my icrecream', '2013-07-03 00:00:00'),
- (2, 1, 2, 2, 'tg', '2013-07-02 00:00:00');
- --
- -- Contraintes pour les tables exportées
- --
- --
- -- Contraintes pour la table `messages`
- --
- ALTER TABLE `messages`
- ADD CONSTRAINT `messages_ibfk_1` FOREIGN KEY (`id_parent`) REFERENCES `messages` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
- ADD CONSTRAINT `messages_ibfk_2` FOREIGN KEY (`id_sender`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
- ADD CONSTRAINT `messages_ibfk_3` FOREIGN KEY (`id_receiver`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
- /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
- /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
- /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement