schema.sql 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  1. CREATE DATABASE IF NOT EXISTS freeradius;
  2. USE freeradius;
  3. CREATE TABLE IF NOT EXISTS `badusers` (
  4. `id` int(10) NOT NULL AUTO_INCREMENT,
  5. `UserName` varchar(30) DEFAULT NULL,
  6. `Date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  7. `Reason` varchar(200) DEFAULT NULL,
  8. `Admin` varchar(30) DEFAULT '-',
  9. PRIMARY KEY (`id`),
  10. KEY `UserName` (`UserName`),
  11. KEY `Date` (`Date`)
  12. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  13. -- --------------------------------------------------------
  14. --
  15. -- Estructura de tabla para la tabla `mtotacct`
  16. --
  17. CREATE TABLE IF NOT EXISTS `mtotacct` (
  18. `MTotAcctId` bigint(21) NOT NULL AUTO_INCREMENT,
  19. `UserName` varchar(64) NOT NULL DEFAULT '',
  20. `AcctDate` date NOT NULL DEFAULT '0000-00-00',
  21. `ConnNum` bigint(12) DEFAULT NULL,
  22. `ConnTotDuration` bigint(12) DEFAULT NULL,
  23. `ConnMaxDuration` bigint(12) DEFAULT NULL,
  24. `ConnMinDuration` bigint(12) DEFAULT NULL,
  25. `InputOctets` bigint(12) DEFAULT NULL,
  26. `OutputOctets` bigint(12) DEFAULT NULL,
  27. `NASIPAddress` varchar(15) DEFAULT NULL,
  28. PRIMARY KEY (`MTotAcctId`),
  29. KEY `UserName` (`UserName`),
  30. KEY `AcctDate` (`AcctDate`),
  31. KEY `UserOnDate` (`UserName`,`AcctDate`),
  32. KEY `NASIPAddress` (`NASIPAddress`)
  33. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  34. -- --------------------------------------------------------
  35. --
  36. -- Estructura de tabla para la tabla `nas`
  37. --
  38. CREATE TABLE IF NOT EXISTS `nas` (
  39. `id` int(10) NOT NULL AUTO_INCREMENT,
  40. `nasname` varchar(128) NOT NULL DEFAULT '',
  41. `shortname` varchar(32) DEFAULT NULL,
  42. `type` varchar(30) DEFAULT 'other',
  43. `ports` int(5) DEFAULT NULL,
  44. `secret` varchar(60) NOT NULL DEFAULT 'secret',
  45. `community` varchar(50) DEFAULT NULL,
  46. `description` varchar(200) DEFAULT 'RADIUS Client',
  47. `server` varchar(32) NOT NULL,
  48. `acct_enabled` tinyint(1) NOT NULL,
  49. PRIMARY KEY (`id`),
  50. KEY `nasname` (`nasname`)
  51. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  52. -- --------------------------------------------------------
  53. --
  54. -- Estructura de tabla para la tabla `radacct`
  55. --
  56. CREATE TABLE IF NOT EXISTS `radacct` (
  57. `radacctid` bigint(21) NOT NULL AUTO_INCREMENT,
  58. `acctsessionid` varchar(64) NOT NULL DEFAULT '',
  59. `acctuniqueid` varchar(32) NOT NULL DEFAULT '',
  60. `username` varchar(64) NOT NULL DEFAULT '',
  61. `groupname` varchar(64) NOT NULL DEFAULT '',
  62. `realm` varchar(64) DEFAULT '',
  63. `nasipaddress` varchar(15) NOT NULL DEFAULT '',
  64. `nasportid` varchar(15) DEFAULT NULL,
  65. `nasporttype` varchar(32) DEFAULT NULL,
  66. `acctstarttime` datetime DEFAULT NULL,
  67. `acctstoptime` datetime DEFAULT NULL,
  68. `acctsessiontime` int(12) DEFAULT NULL,
  69. `acctauthentic` varchar(32) DEFAULT NULL,
  70. `connectinfo_start` varchar(50) DEFAULT NULL,
  71. `connectinfo_stop` varchar(50) DEFAULT NULL,
  72. `acctinputoctets` bigint(20) DEFAULT NULL,
  73. `acctoutputoctets` bigint(20) DEFAULT NULL,
  74. `calledstationid` varchar(50) NOT NULL DEFAULT '',
  75. `callingstationid` varchar(50) NOT NULL DEFAULT '',
  76. `acctterminatecause` varchar(32) NOT NULL DEFAULT '',
  77. `servicetype` varchar(32) DEFAULT NULL,
  78. `framedprotocol` varchar(32) DEFAULT NULL,
  79. `framedipaddress` varchar(15) NOT NULL DEFAULT '',
  80. `acctstartdelay` int(12) DEFAULT NULL,
  81. `acctstopdelay` int(12) DEFAULT NULL,
  82. `xascendsessionsvrkey` varchar(10) DEFAULT NULL,
  83. `updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  84. PRIMARY KEY (`radacctid`),
  85. KEY `username` (`username`),
  86. KEY `framedipaddress` (`framedipaddress`),
  87. KEY `acctsessionid` (`acctsessionid`),
  88. KEY `acctsessiontime` (`acctsessiontime`),
  89. KEY `acctuniqueid` (`acctuniqueid`),
  90. KEY `acctstarttime` (`acctstarttime`),
  91. KEY `acctstoptime` (`acctstoptime`),
  92. KEY `nasipaddress` (`nasipaddress`)
  93. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  94. -- --------------------------------------------------------
  95. --
  96. -- Estructura de tabla para la tabla `radcheck`
  97. --
  98. CREATE TABLE IF NOT EXISTS `radcheck` (
  99. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  100. `UserName` varbinary(64) NOT NULL DEFAULT '',
  101. `Attribute` varchar(32) NOT NULL DEFAULT '',
  102. `op` char(2) NOT NULL DEFAULT '==',
  103. `Value` varchar(253) NOT NULL DEFAULT '',
  104. PRIMARY KEY (`id`),
  105. KEY `UserName` (`UserName`(32))
  106. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PACK_KEYS=0 AUTO_INCREMENT=1 ;
  107. -- --------------------------------------------------------
  108. --
  109. -- Estructura de tabla para la tabla `radgroupcheck`
  110. --
  111. CREATE TABLE IF NOT EXISTS `radgroupcheck` (
  112. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  113. `GroupName` varchar(64) NOT NULL DEFAULT '',
  114. `Attribute` varchar(32) NOT NULL DEFAULT '',
  115. `op` char(2) NOT NULL DEFAULT '==',
  116. `Value` varchar(253) NOT NULL DEFAULT '',
  117. PRIMARY KEY (`id`),
  118. KEY `GroupName` (`GroupName`(32))
  119. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  120. -- --------------------------------------------------------
  121. --
  122. -- Estructura de tabla para la tabla `radgroupreply`
  123. --
  124. CREATE TABLE IF NOT EXISTS `radgroupreply` (
  125. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  126. `GroupName` varchar(64) NOT NULL DEFAULT '',
  127. `Attribute` varchar(32) NOT NULL DEFAULT '',
  128. `op` char(2) NOT NULL DEFAULT '=',
  129. `Value` varchar(253) NOT NULL DEFAULT '',
  130. `prio` int(10) unsigned NOT NULL DEFAULT '0',
  131. PRIMARY KEY (`id`),
  132. KEY `GroupName` (`GroupName`(32))
  133. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  134. -- --------------------------------------------------------
  135. --
  136. -- Estructura de tabla para la tabla `radpostauth`
  137. --
  138. CREATE TABLE IF NOT EXISTS `radpostauth` (
  139. `id` int(11) NOT NULL AUTO_INCREMENT,
  140. `username` varchar(64) NOT NULL DEFAULT '',
  141. `pass` varchar(64) NOT NULL DEFAULT '',
  142. `reply` varchar(32) NOT NULL DEFAULT '',
  143. `authdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  144. PRIMARY KEY (`id`)
  145. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  146. -- --------------------------------------------------------
  147. --
  148. -- Estructura de tabla para la tabla `radreply`
  149. --
  150. CREATE TABLE IF NOT EXISTS `radreply` (
  151. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  152. `UserName` varchar(64) NOT NULL DEFAULT '',
  153. `Attribute` varchar(32) NOT NULL DEFAULT '',
  154. `op` char(2) NOT NULL DEFAULT '=',
  155. `Value` varchar(253) NOT NULL DEFAULT '',
  156. PRIMARY KEY (`id`),
  157. KEY `UserName` (`UserName`(32))
  158. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  159. -- --------------------------------------------------------
  160. --
  161. -- Estructura de tabla para la tabla `radusergroup`
  162. --
  163. CREATE TABLE IF NOT EXISTS `radusergroup` (
  164. `username` varchar(64) NOT NULL DEFAULT '',
  165. `groupname` varchar(64) NOT NULL DEFAULT '',
  166. `priority` int(11) NOT NULL DEFAULT '1',
  167. KEY `username` (`username`(32))
  168. ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
  169. -- --------------------------------------------------------
  170. --
  171. -- Estructura de tabla para la tabla `totacct`
  172. --
  173. CREATE TABLE IF NOT EXISTS `totacct` (
  174. `TotAcctId` bigint(21) NOT NULL AUTO_INCREMENT,
  175. `UserName` varchar(64) NOT NULL DEFAULT '',
  176. `AcctDate` date NOT NULL DEFAULT '0000-00-00',
  177. `ConnNum` bigint(12) DEFAULT NULL,
  178. `ConnTotDuration` bigint(12) DEFAULT NULL,
  179. `ConnMaxDuration` bigint(12) DEFAULT NULL,
  180. `ConnMinDuration` bigint(12) DEFAULT NULL,
  181. `InputOctets` bigint(12) DEFAULT NULL,
  182. `OutputOctets` bigint(12) DEFAULT NULL,
  183. `NASIPAddress` varchar(15) DEFAULT NULL,
  184. PRIMARY KEY (`TotAcctId`),
  185. KEY `UserName` (`UserName`),
  186. KEY `AcctDate` (`AcctDate`),
  187. KEY `UserOnDate` (`UserName`,`AcctDate`),
  188. KEY `NASIPAddress` (`NASIPAddress`),
  189. KEY `NASIPAddressOnDate` (`AcctDate`,`NASIPAddress`)
  190. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  191. -- --------------------------------------------------------
  192. --
  193. -- Estructura de tabla para la tabla `usergroup`
  194. --
  195. CREATE TABLE IF NOT EXISTS `usergroup` (
  196. `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  197. `UserName` varchar(64) NOT NULL DEFAULT '',
  198. `GroupName` varchar(64) NOT NULL DEFAULT '',
  199. PRIMARY KEY (`id`),
  200. KEY `UserName` (`UserName`(32))
  201. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  202. -- --------------------------------------------------------
  203. --
  204. -- Estructura de tabla para la tabla `userinfo`
  205. --
  206. CREATE TABLE IF NOT EXISTS `userinfo` (
  207. `id` int(10) NOT NULL AUTO_INCREMENT,
  208. `UserName` varchar(30) DEFAULT NULL,
  209. `Name` varchar(200) DEFAULT NULL,
  210. `Mail` varchar(200) DEFAULT NULL,
  211. `Department` varchar(200) DEFAULT NULL,
  212. `WorkPhone` varchar(200) DEFAULT NULL,
  213. `HomePhone` varchar(200) DEFAULT NULL,
  214. `Mobile` varchar(200) DEFAULT NULL,
  215. PRIMARY KEY (`id`),
  216. KEY `UserName` (`UserName`),
  217. KEY `Departmet` (`Department`)
  218. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;