ircd.sql 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. -- phpMyAdmin SQL Dump
  2. -- version 4.0.4.1
  3. -- http://www.phpmyadmin.net
  4. --
  5. -- Host: 127.0.0.1
  6. -- Generation Time: Feb 20, 2014 at 02:10 AM
  7. -- Server version: 5.6.11
  8. -- PHP Version: 5.5.3
  9. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  10. SET AUTOCOMMIT = 0;
  11. START TRANSACTION;
  12. SET time_zone = "+00:00";
  13. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  14. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  15. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  16. /*!40101 SET NAMES utf8 */;
  17. --
  18. -- Database: `ircd`
  19. --
  20. CREATE DATABASE IF NOT EXISTS `ircd` DEFAULT CHARACTER SET latin1 COLLATE latin1_general_ci;
  21. USE `ircd`;
  22. -- --------------------------------------------------------
  23. --
  24. -- Stand-in structure for view `children_v`
  25. --
  26. DROP VIEW IF EXISTS `children_v`;
  27. CREATE TABLE IF NOT EXISTS `children_v` (
  28. `user_id` int(100)
  29. ,`parent_id` int(100)
  30. ,`child_id` int(100)
  31. );
  32. -- --------------------------------------------------------
  33. --
  34. -- Table structure for table `configuration`
  35. --
  36. -- Creation: Feb 19, 2014 at 10:35 PM
  37. --
  38. DROP TABLE IF EXISTS `configuration`;
  39. CREATE TABLE IF NOT EXISTS `configuration` (
  40. `key` varchar(100) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  41. `description` varchar(100) NOT NULL,
  42. `value` varchar(4000) DEFAULT NULL,
  43. `type` varchar(100) NOT NULL,
  44. PRIMARY KEY (`key`),
  45. UNIQUE KEY `key` (`key`),
  46. KEY `key_2` (`key`)
  47. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  48. --
  49. -- Dumping data for table `configuration`
  50. --
  51. INSERT INTO `configuration` (`key`, `description`, `value`, `type`) VALUES
  52. ('2-factor-method', '2-Factor Method', 'none', 'list'),
  53. ('authy-api-key', 'Authy API Key', NULL, 'string'),
  54. ('authy-endpoint', 'Authy Endpoint', 'http://sandbox-api.authy.com', 'list'),
  55. ('irc-port', 'Main Server Port', '6667', 'number'),
  56. ('irc-server', 'Main Server', NULL, 'lookup'),
  57. ('mibbit-password', 'Mibbit Password', NULL, 'string'),
  58. ('ops-channel', 'Opers Channel', '#opers', 'string'),
  59. ('persona-audience', 'Persona Audience', NULL, 'string'),
  60. ('persona-endpoint', 'Persona Endpoint', 'none', 'list'),
  61. ('rehash-pass', 'RehashServ Password', NULL, 'string'),
  62. ('rehash-host', 'RehashServ Host', NULL, 'string'),
  63. ('server-pass', 'Server-to-Server Password', NULL, 'string'),
  64. ('services-server', 'Services Server', NULL, 'lookup'),
  65. ('stats-server', 'Stats Server', NULL, 'lookup'),
  66. ('xmlrpc-path', 'XMLRPC Path', '/xmlrpc', 'string'),
  67. ('xmlrpc-port', 'XMLRPC Port', '9900', 'number'),
  68. ('xmlrpc-server', 'XMLRPC Server', NULL, 'lookup');
  69. -- --------------------------------------------------------
  70. --
  71. -- Table structure for table `configuration_lists`
  72. --
  73. -- Creation: Feb 19, 2014 at 10:35 PM
  74. --
  75. DROP TABLE IF EXISTS `configuration_lists`;
  76. CREATE TABLE IF NOT EXISTS `configuration_lists` (
  77. `id` int(100) NOT NULL AUTO_INCREMENT,
  78. `key` varchar(100) COLLATE latin1_general_ci NOT NULL,
  79. `value` varchar(4000) COLLATE latin1_general_ci NOT NULL,
  80. `label` varchar(100) COLLATE latin1_general_ci NOT NULL,
  81. PRIMARY KEY (`id`),
  82. KEY `key` (`key`)
  83. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=8 ;
  84. --
  85. -- RELATIONS FOR TABLE `configuration_lists`:
  86. -- `key`
  87. -- `configuration` -> `key`
  88. --
  89. --
  90. -- Dumping data for table `configuration_lists`
  91. --
  92. INSERT INTO `configuration_lists` (`id`, `key`, `value`, `label`) VALUES
  93. (1, '2-factor-method', 'none', '(none)'),
  94. (2, '2-factor-method', 'google-authenticator', 'Google Authenticator'),
  95. (3, '2-factor-method', 'authy', 'Authy'),
  96. (4, 'authy-endpoint', 'https://api.authy.com', 'Production'),
  97. (5, 'authy-endpoint', 'http://sandbox-api.authy.com', 'Sandbox'),
  98. (6, 'persona-endpoint', 'none', '(none)'),
  99. (7, 'persona-endpoint', 'https://verifier.login.persona.org/verify', 'Production');
  100. -- --------------------------------------------------------
  101. --
  102. -- Table structure for table `configuration_lookups`
  103. --
  104. -- Creation: Feb 19, 2014 at 10:35 PM
  105. --
  106. DROP TABLE IF EXISTS `configuration_lookups`;
  107. CREATE TABLE IF NOT EXISTS `configuration_lookups` (
  108. `id` int(100) NOT NULL AUTO_INCREMENT,
  109. `key` varchar(100) COLLATE latin1_general_ci NOT NULL,
  110. `table` varchar(100) COLLATE latin1_general_ci NOT NULL,
  111. `column` varchar(100) COLLATE latin1_general_ci NOT NULL,
  112. `label_column` varchar(100) COLLATE latin1_general_ci NOT NULL,
  113. `enabled_column` varchar(100) COLLATE latin1_general_ci DEFAULT NULL,
  114. PRIMARY KEY (`id`),
  115. KEY `configuration_key` (`key`)
  116. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=5 ;
  117. --
  118. -- RELATIONS FOR TABLE `configuration_lookups`:
  119. -- `key`
  120. -- `configuration` -> `key`
  121. --
  122. --
  123. -- Dumping data for table `configuration_lookups`
  124. --
  125. INSERT INTO `configuration_lookups` (`id`, `key`, `table`, `column`, `label_column`, `enabled_column`) VALUES
  126. (1, 'irc-server', 'servers', 'ip', 'name', '!uline'),
  127. (2, 'services-server', 'servers', 'host', 'name', 'uline'),
  128. (3, 'stats-server', 'servers', 'host', 'name', 'uline'),
  129. (4, 'xmlrpc-server', 'servers', 'ip', 'name', 'uline');
  130. -- --------------------------------------------------------
  131. --
  132. -- Table structure for table `emails`
  133. --
  134. -- Creation: Feb 19, 2014 at 10:35 PM
  135. --
  136. DROP TABLE IF EXISTS `emails`;
  137. CREATE TABLE IF NOT EXISTS `emails` (
  138. `id` int(100) NOT NULL AUTO_INCREMENT,
  139. `user_id` int(100) NOT NULL,
  140. `email` varchar(100) COLLATE latin1_general_ci NOT NULL,
  141. PRIMARY KEY (`id`),
  142. UNIQUE KEY `email` (`email`),
  143. KEY `user_id` (`user_id`)
  144. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=16 ;
  145. --
  146. -- RELATIONS FOR TABLE `emails`:
  147. -- `user_id`
  148. -- `users` -> `id`
  149. --
  150. -- --------------------------------------------------------
  151. --
  152. -- Table structure for table `hosts`
  153. --
  154. -- Creation: Feb 19, 2014 at 10:35 PM
  155. --
  156. DROP TABLE IF EXISTS `hosts`;
  157. CREATE TABLE IF NOT EXISTS `hosts` (
  158. `id` int(100) NOT NULL AUTO_INCREMENT,
  159. `oper_id` int(100) NOT NULL,
  160. `host` varchar(100) NOT NULL,
  161. PRIMARY KEY (`id`),
  162. KEY `oper_id` (`oper_id`)
  163. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=20 ;
  164. --
  165. -- RELATIONS FOR TABLE `hosts`:
  166. -- `oper_id`
  167. -- `opers` -> `id`
  168. --
  169. -- --------------------------------------------------------
  170. --
  171. -- Table structure for table `opers`
  172. --
  173. -- Creation: Feb 19, 2014 at 10:35 PM
  174. --
  175. DROP TABLE IF EXISTS `opers`;
  176. CREATE TABLE IF NOT EXISTS `opers` (
  177. `id` int(100) NOT NULL AUTO_INCREMENT,
  178. `nick` varchar(20) NOT NULL,
  179. `role_id` int(11) NOT NULL,
  180. `user_id` int(100) NOT NULL,
  181. `manager_id` int(100) NOT NULL,
  182. `server_id` int(100) DEFAULT NULL,
  183. `password` varchar(100) NOT NULL,
  184. `password_type_id` int(100) NOT NULL,
  185. `swhois` varchar(100) DEFAULT NULL,
  186. PRIMARY KEY (`id`),
  187. UNIQUE KEY `id` (`id`),
  188. UNIQUE KEY `nick` (`nick`),
  189. KEY `id_2` (`id`),
  190. KEY `nick_2` (`nick`),
  191. KEY `role_id` (`role_id`),
  192. KEY `password_type_id` (`password_type_id`),
  193. KEY `user_id` (`manager_id`),
  194. KEY `server_id` (`server_id`),
  195. KEY `user_id_2` (`user_id`)
  196. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;
  197. --
  198. -- RELATIONS FOR TABLE `opers`:
  199. -- `password_type_id`
  200. -- `password_type` -> `id`
  201. -- `server_id`
  202. -- `servers` -> `id`
  203. -- `role_id`
  204. -- `oper_roles` -> `id`
  205. -- `manager_id`
  206. -- `users` -> `id`
  207. --
  208. -- --------------------------------------------------------
  209. --
  210. -- Stand-in structure for view `opers_v`
  211. --
  212. DROP VIEW IF EXISTS `opers_v`;
  213. CREATE TABLE IF NOT EXISTS `opers_v` (
  214. `id` int(100)
  215. ,`user_id` int(100)
  216. ,`manager_id` int(100)
  217. ,`server_id` int(100)
  218. ,`nick` varchar(20)
  219. ,`password` varchar(100)
  220. ,`password_type` varchar(100)
  221. ,`swhois` varchar(100)
  222. ,`flags` varchar(4000)
  223. ,`role` varchar(20)
  224. );
  225. -- --------------------------------------------------------
  226. --
  227. -- Table structure for table `oper_roles`
  228. --
  229. -- Creation: Feb 19, 2014 at 10:35 PM
  230. --
  231. DROP TABLE IF EXISTS `oper_roles`;
  232. CREATE TABLE IF NOT EXISTS `oper_roles` (
  233. `id` int(100) NOT NULL AUTO_INCREMENT,
  234. `name` varchar(20) NOT NULL,
  235. `flags` varchar(4000) NOT NULL,
  236. PRIMARY KEY (`id`),
  237. UNIQUE KEY `name` (`name`)
  238. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
  239. --
  240. -- Dumping data for table `oper_roles`
  241. --
  242. INSERT INTO `oper_roles` (`id`, `name`, `flags`) VALUES
  243. (1, 'netadmin', 'netadmin;\ncan_restart;\ncan_die;\ncan_gkline;\ncan_zline;\ncan_gzline;\ncan_override;\ncan_addline;\nget_host;'),
  244. (2, 'global', 'global;\ncan_override;\ncan_setq;\ncan_addline;\ncan_dccdeny;\nget_host;'),
  245. (3, 'servicesadmin', 'services-admin;\r\ncan_override;\r\ncan_setq;\r\ncan_addline;\r\ncan_dccdeny;\r\nget_host;');
  246. -- --------------------------------------------------------
  247. --
  248. -- Table structure for table `password_type`
  249. --
  250. -- Creation: Feb 19, 2014 at 10:35 PM
  251. --
  252. DROP TABLE IF EXISTS `password_type`;
  253. CREATE TABLE IF NOT EXISTS `password_type` (
  254. `id` int(100) NOT NULL AUTO_INCREMENT,
  255. `name` varchar(100) NOT NULL,
  256. PRIMARY KEY (`id`),
  257. UNIQUE KEY `name` (`name`)
  258. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
  259. --
  260. -- Dumping data for table `password_type`
  261. --
  262. INSERT INTO `password_type` (`id`, `name`) VALUES
  263. (1, 'md5'),
  264. (2, 'sha1');
  265. -- --------------------------------------------------------
  266. --
  267. -- Table structure for table `servers`
  268. --
  269. -- Creation: Feb 19, 2014 at 10:35 PM
  270. --
  271. DROP TABLE IF EXISTS `servers`;
  272. CREATE TABLE IF NOT EXISTS `servers` (
  273. `id` int(100) NOT NULL AUTO_INCREMENT,
  274. `name` varchar(100) NOT NULL,
  275. `host` varchar(100) NOT NULL,
  276. `description` varchar(4000) NOT NULL,
  277. `parent_id` int(100) DEFAULT NULL,
  278. `user_id` int(100) NOT NULL,
  279. `ip` varchar(15) NOT NULL,
  280. `uline` tinyint(1) NOT NULL DEFAULT '0',
  281. PRIMARY KEY (`id`),
  282. UNIQUE KEY `name` (`name`,`host`),
  283. KEY `parent_id` (`parent_id`),
  284. KEY `user_id` (`user_id`)
  285. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;
  286. --
  287. -- RELATIONS FOR TABLE `servers`:
  288. -- `parent_id`
  289. -- `servers` -> `id`
  290. -- `user_id`
  291. -- `users` -> `id`
  292. --
  293. -- --------------------------------------------------------
  294. --
  295. -- Stand-in structure for view `ulines_v`
  296. --
  297. DROP VIEW IF EXISTS `ulines_v`;
  298. CREATE TABLE IF NOT EXISTS `ulines_v` (
  299. `id` int(100)
  300. ,`host` varchar(100)
  301. );
  302. -- --------------------------------------------------------
  303. --
  304. -- Table structure for table `users`
  305. --
  306. -- Creation: Feb 19, 2014 at 10:35 PM
  307. --
  308. DROP TABLE IF EXISTS `users`;
  309. CREATE TABLE IF NOT EXISTS `users` (
  310. `id` int(100) NOT NULL AUTO_INCREMENT,
  311. `api_key` varchar(24) NOT NULL,
  312. `secret_key` varchar(100) DEFAULT NULL,
  313. `password` varchar(40) NOT NULL,
  314. `real_name` varchar(50) NOT NULL,
  315. `nick` varchar(20) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  316. `email` varchar(100) NOT NULL,
  317. PRIMARY KEY (`id`),
  318. UNIQUE KEY `api_key` (`api_key`),
  319. UNIQUE KEY `nick` (`nick`),
  320. KEY `authy_id` (`secret_key`)
  321. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;
  322. --
  323. -- Dumping data for table `users`
  324. --
  325. INSERT INTO `users` (`id`, `api_key`, `secret_key`, `password`, `real_name`, `nick`, `email`) VALUES
  326. (7, '1', NULL, '$Dj94pkis$Fs5kyCo4ocTT7zh8asWNJwIelP0=', 'root', 'root', '');
  327. -- --------------------------------------------------------
  328. --
  329. -- Table structure for table `user_roles`
  330. --
  331. -- Creation: Feb 19, 2014 at 10:35 PM
  332. --
  333. DROP TABLE IF EXISTS `user_roles`;
  334. CREATE TABLE IF NOT EXISTS `user_roles` (
  335. `id` int(100) NOT NULL AUTO_INCREMENT,
  336. `user_id` int(100) NOT NULL,
  337. `user_role_id` int(100) NOT NULL,
  338. PRIMARY KEY (`id`),
  339. KEY `user_id` (`user_id`,`user_role_id`),
  340. KEY `user_role_id` (`user_role_id`)
  341. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ;
  342. --
  343. -- RELATIONS FOR TABLE `user_roles`:
  344. -- `user_id`
  345. -- `users` -> `id`
  346. -- `user_role_id`
  347. -- `user_role_types` -> `id`
  348. --
  349. --
  350. -- Dumping data for table `user_roles`
  351. --
  352. INSERT INTO `user_roles` (`id`, `user_id`, `user_role_id`) VALUES
  353. (13, 7, 4);
  354. -- --------------------------------------------------------
  355. --
  356. -- Table structure for table `user_role_types`
  357. --
  358. -- Creation: Feb 19, 2014 at 10:35 PM
  359. --
  360. DROP TABLE IF EXISTS `user_role_types`;
  361. CREATE TABLE IF NOT EXISTS `user_role_types` (
  362. `id` int(100) NOT NULL AUTO_INCREMENT,
  363. `name` varchar(100) NOT NULL,
  364. `description` varchar(100) NOT NULL,
  365. `flags` varchar(3) NOT NULL DEFAULT 'o',
  366. PRIMARY KEY (`id`),
  367. UNIQUE KEY `name` (`name`),
  368. UNIQUE KEY `description` (`description`)
  369. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
  370. --
  371. -- Dumping data for table `user_role_types`
  372. --
  373. INSERT INTO `user_role_types` (`id`, `name`, `description`, `flags`) VALUES
  374. (1, 'oper', 'Oper', 'o'),
  375. (2, 'admin', 'Server Manager', 'n'),
  376. (3, 'netadmin', 'Network Admin', 'on'),
  377. (4, 'globaladmin', 'Global Admin', 'nao');
  378. -- --------------------------------------------------------
  379. --
  380. -- Structure for view `children_v`
  381. --
  382. DROP TABLE IF EXISTS `children_v`;
  383. CREATE ALGORITHM=UNDEFINED DEFINER=`ircd`@`localhost` SQL SECURITY DEFINER VIEW `children_v` AS select `p`.`user_id` AS `user_id`,`p`.`id` AS `parent_id`,`c`.`id` AS `child_id` from (`servers` `c` left join `servers` `p` on((`p`.`id` = `c`.`parent_id`))) where ((`p`.`user_id` is not null) and (`c`.`user_id` is not null) and (`c`.`parent_id` is not null) and (`c`.`uline` = 0));
  384. -- --------------------------------------------------------
  385. --
  386. -- Structure for view `opers_v`
  387. --
  388. DROP TABLE IF EXISTS `opers_v`;
  389. CREATE ALGORITHM=UNDEFINED DEFINER=`ircd`@`localhost` SQL SECURITY DEFINER VIEW `opers_v` AS select `o`.`id` AS `id`,`o`.`user_id` AS `user_id`,`o`.`manager_id` AS `manager_id`,`o`.`server_id` AS `server_id`,`o`.`nick` AS `nick`,`o`.`password` AS `password`,`p`.`name` AS `password_type`,`o`.`swhois` AS `swhois`,`r`.`flags` AS `flags`,`r`.`name` AS `role` from ((`opers` `o` join `oper_roles` `r` on((`r`.`id` = `o`.`role_id`))) join `password_type` `p` on((`p`.`id` = `o`.`password_type_id`)));
  390. -- --------------------------------------------------------
  391. --
  392. -- Structure for view `ulines_v`
  393. --
  394. DROP TABLE IF EXISTS `ulines_v`;
  395. CREATE ALGORITHM=UNDEFINED DEFINER=`ircd`@`localhost` SQL SECURITY DEFINER VIEW `ulines_v` AS select `s`.`id` AS `id`,`s`.`host` AS `host` from `servers` `s` where (`s`.`uline` = 1);
  396. --
  397. -- Constraints for dumped tables
  398. --
  399. --
  400. -- Constraints for table `configuration_lists`
  401. --
  402. ALTER TABLE `configuration_lists`
  403. ADD CONSTRAINT `configuration_lists_ibfk_1` FOREIGN KEY (`key`) REFERENCES `configuration` (`key`) ON DELETE CASCADE ON UPDATE CASCADE;
  404. --
  405. -- Constraints for table `configuration_lookups`
  406. --
  407. ALTER TABLE `configuration_lookups`
  408. ADD CONSTRAINT `configuration_lookups_ibfk_1` FOREIGN KEY (`key`) REFERENCES `configuration` (`key`) ON DELETE CASCADE ON UPDATE CASCADE;
  409. --
  410. -- Constraints for table `emails`
  411. --
  412. ALTER TABLE `emails`
  413. ADD CONSTRAINT `emails_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  414. --
  415. -- Constraints for table `hosts`
  416. --
  417. ALTER TABLE `hosts`
  418. ADD CONSTRAINT `hosts_ibfk_1` FOREIGN KEY (`oper_id`) REFERENCES `opers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  419. --
  420. -- Constraints for table `opers`
  421. --
  422. ALTER TABLE `opers`
  423. ADD CONSTRAINT `opers_ibfk_2` FOREIGN KEY (`password_type_id`) REFERENCES `password_type` (`id`),
  424. ADD CONSTRAINT `opers_ibfk_4` FOREIGN KEY (`server_id`) REFERENCES `servers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  425. ADD CONSTRAINT `opers_ibfk_5` FOREIGN KEY (`role_id`) REFERENCES `oper_roles` (`id`),
  426. ADD CONSTRAINT `opers_ibfk_6` FOREIGN KEY (`manager_id`) REFERENCES `users` (`id`);
  427. --
  428. -- Constraints for table `servers`
  429. --
  430. ALTER TABLE `servers`
  431. ADD CONSTRAINT `servers_ibfk_1` FOREIGN KEY (`parent_id`) REFERENCES `servers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  432. ADD CONSTRAINT `servers_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
  433. --
  434. -- Constraints for table `user_roles`
  435. --
  436. ALTER TABLE `user_roles`
  437. ADD CONSTRAINT `user_roles_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  438. ADD CONSTRAINT `user_roles_ibfk_2` FOREIGN KEY (`user_role_id`) REFERENCES `user_role_types` (`id`) ON UPDATE CASCADE;
  439. COMMIT;
  440. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  441. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  442. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;