init.sql 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. -- phpMyAdmin SQL Dump
  2. -- version 4.2.12deb2
  3. -- http://www.phpmyadmin.net
  4. --
  5. -- Host: localhost
  6. -- Generation Time: 2015-07-08 17:18:45
  7. -- 服务器版本: 5.6.24-0ubuntu2
  8. -- PHP Version: 5.6.4-4ubuntu6.2
  9. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  10. SET time_zone = "+00:00";
  11. --
  12. -- Database: `shorturl`
  13. --
  14. -- --------------------------------------------------------
  15. --
  16. -- 表的结构 `short_urls`
  17. --
  18. CREATE TABLE IF NOT EXISTS `short_urls` (
  19. `id` int(10) unsigned NOT NULL,
  20. `long_url` varchar(255) NOT NULL,
  21. `code` varchar(32) NOT NULL,
  22. `short_code` varbinary(6) NOT NULL,
  23. `date_created` int(10) unsigned NOT NULL,
  24. `counter` int(10) unsigned NOT NULL DEFAULT '0'
  25. ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
  26. --
  27. -- Indexes for dumped tables
  28. --
  29. --
  30. -- Indexes for table `short_urls`
  31. --
  32. ALTER TABLE `short_urls`
  33. ADD PRIMARY KEY (`id`), ADD KEY `short_code` (`short_code`);
  34. --
  35. -- AUTO_INCREMENT for dumped tables
  36. --
  37. --
  38. -- AUTO_INCREMENT for table `short_urls`
  39. --
  40. ALTER TABLE `short_urls`
  41. MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;