-- https://www.phpmyadmin.net/
--


--
-- Database: `flyly`
--

-- --------------------------------------------------------

--
-- Table structure for table `messages`
--

CREATE TABLE `messages` (
  `id` int(11) NOT NULL,
  `body` text NOT NULL,
  `send_id` int(11) NOT NULL,
  `rcv_id` int(11) NOT NULL,
  `msgTime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `messages`
--

INSERT INTO `messages` (`id`, `body`, `send_id`, `rcv_id`, `msgTime`) VALUES
(1, 'test message please ignore', 9, 10, '2017-04-11 18:44:55'),
(2, 'this is a pretty good idea', 10, 9, '2017-04-11 18:45:11'),
(3, 'How do i include long messages?', 9, 11, '2017-04-11 18:46:00'),
(4, '```css\r\ntext-overflow: ellipsis;\r\noverflow: hidden;\r\n```', 11, 9, '2017-04-11 18:46:03'),
(5, 'one', 10, 11, '2017-04-16 13:26:20'),
(6, 'ptwo', 11, 10, '2017-04-16 13:28:42'),
(7, 'three', 11, 10, '2017-04-16 21:16:04'),
(8, 'four', 11, 10, '2017-04-16 21:17:06'),
(9, 'five', 10, 11, '2017-04-16 21:17:10'),
(10, '6', 11, 10, '2017-04-16 21:17:25'),
(11, '7', 11, 10, '2017-04-16 21:17:32'),
(12, '8', 11, 10, '2017-04-16 21:29:58'),
(13, 'nine', 11, 10, '2017-04-16 21:31:15'),
(14, 'ten', 10, 11, '2017-04-16 23:42:05'),
(15, 'eleven', 10, 11, '2017-04-16 23:42:23'),
(16, 'twelve', 10, 11, '2017-04-16 23:43:09');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `messages`
--
ALTER TABLE `messages`
  ADD PRIMARY KEY (`id`),
  ADD KEY `send_id` (`send_id`),
  ADD KEY `rcv_id` (`rcv_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `messages`
--
ALTER TABLE `messages`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
--
-- Constraints for dumped tables
--

--
-- Constraints for table `messages`
--
ALTER TABLE `messages`
  ADD CONSTRAINT `messages_ibfk_1` FOREIGN KEY (`send_id`) REFERENCES `users` (`userid`),
  ADD CONSTRAINT `messages_ibfk_2` FOREIGN KEY (`rcv_id`) REFERENCES `users` (`userid`);
