db-schema.sql 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. -- phpMyAdmin SQL Dump
  2. -- version 3.4.10.1deb1
  3. -- http://www.phpmyadmin.net
  4. --
  5. -- Host: localhost
  6. -- Generation Time: Jan 25, 2015 at 05:22 PM
  7. -- Server version: 5.5.40
  8. -- PHP Version: 5.4.36-1+deb.sury.org~precise+2
  9. SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
  10. SET time_zone = "+00:00";
  11. --
  12. -- Database: `go_kurz`
  13. --
  14. -- --------------------------------------------------------
  15. --
  16. -- Table structure for table `longurl`
  17. --
  18. CREATE TABLE IF NOT EXISTS `longurl` (
  19. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  20. `url` varchar(32) NOT NULL COMMENT 'The short URL itself',
  21. PRIMARY KEY (`id`),
  22. UNIQUE KEY `url` (`url`)
  23. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  24. -- --------------------------------------------------------
  25. --
  26. -- Table structure for table `shorturl`
  27. --
  28. CREATE TABLE IF NOT EXISTS `shorturl` (
  29. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  30. `url` varchar(32) NOT NULL COMMENT 'The short URL itself',
  31. `longurl` bigint(20) unsigned NOT NULL,
  32. `domain` int(11) NOT NULL,
  33. `strategy` varchar(8) NOT NULL DEFAULT 'base',
  34. `submittedBy` int(11) NOT NULL,
  35. `submittedInfo` int(11) NOT NULL,
  36. `isEnabled` tinyint(1) NOT NULL,
  37. PRIMARY KEY (`id`),
  38. UNIQUE KEY `url` (`url`),
  39. KEY `longurl` (`longurl`)
  40. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
  41. -- --------------------------------------------------------
  42. --
  43. -- Table structure for table `eventinfo`
  44. --
  45. CREATE TABLE IF NOT EXISTS `eventinfo` (
  46. `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  47. `source` varchar(8) DEFAULT NULL COMMENT 'The event source',
  48. `ip` varchar(30) NOT NULL DEFAULT '' COMMENT 'May be IPv4 or IPv6',
  49. UNIQUE KEY `id` (`id`),
  50. KEY `ip` (`ip`),
  51. KEY `source` (`source`)
  52. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Event info' AUTO_INCREMENT=1 ;
  53. --
  54. -- Constraints for dumped tables
  55. --
  56. --
  57. -- Constraints for table `shorturl`
  58. --
  59. ALTER TABLE `shorturl`
  60. ADD CONSTRAINT `shorturl_fk_longurl` FOREIGN KEY (`longurl`) REFERENCES `longurl` (`id`);