sessions.sql 728 B

1234567891011121314151617181920212223242526272829
  1. -- --------------------------------------------------------
  2. --
  3. -- Table structure for table `sessions`
  4. --
  5. -- Creation: Aug 21, 2015 at 06:55 PM
  6. --
  7. DROP TABLE IF EXISTS `sessions`;
  8. CREATE TABLE IF NOT EXISTS `sessions` (
  9. `id` varchar(256) COLLATE utf8_bin NOT NULL,
  10. `u_id` int(11) NOT NULL,
  11. `ip` varchar(39) COLLATE utf8_bin NOT NULL,
  12. `info` varchar(4000) COLLATE utf8_bin NOT NULL,
  13. `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
  14. ) ENGINE=MEMORY DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
  15. --
  16. -- RELATIONS FOR TABLE `sessions`:
  17. -- `u_id`
  18. -- `users` -> `id`
  19. --
  20. --
  21. -- Indexes for table `sessions`
  22. --
  23. ALTER TABLE `sessions`
  24. ADD PRIMARY KEY (`id`),
  25. ADD KEY `u_id` (`u_id`,`ip`);