git.sql 41 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244
  1. CREATE DATABASE git DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
  2. use git;
  3. -- phpMyAdmin SQL Dump
  4. -- version 5.1.0
  5. -- https://www.phpmyadmin.net/
  6. --
  7. -- Host: localhost
  8. -- Generation Time: Apr 27, 2022 at 01:02 AM
  9. -- Server version: 5.7.37-0ubuntu0.18.04.1
  10. -- PHP Version: 7.2.24-0ubuntu0.18.04.11
  11. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  12. START TRANSACTION;
  13. SET time_zone = "+00:00";
  14. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  15. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  16. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  17. /*!40101 SET NAMES utf8mb4 */;
  18. --
  19. -- Database: `git`
  20. --
  21. -- --------------------------------------------------------
  22. --
  23. -- Table structure for table `access`
  24. --
  25. CREATE TABLE `access` (
  26. `id` bigint(20) NOT NULL,
  27. `user_id` bigint(20) DEFAULT NULL,
  28. `repo_id` bigint(20) DEFAULT NULL,
  29. `mode` int(11) DEFAULT NULL
  30. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  31. -- --------------------------------------------------------
  32. --
  33. -- Table structure for table `access_token`
  34. --
  35. CREATE TABLE `access_token` (
  36. `id` bigint(20) NOT NULL,
  37. `uid` bigint(20) DEFAULT NULL,
  38. `name` varchar(255) DEFAULT NULL,
  39. `sha1` varchar(40) DEFAULT NULL,
  40. `created_unix` bigint(20) DEFAULT NULL,
  41. `updated_unix` bigint(20) DEFAULT NULL
  42. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  43. -- --------------------------------------------------------
  44. --
  45. -- Table structure for table `action`
  46. --
  47. CREATE TABLE `action` (
  48. `id` bigint(20) NOT NULL,
  49. `user_id` bigint(20) DEFAULT NULL,
  50. `op_type` int(11) DEFAULT NULL,
  51. `act_user_id` bigint(20) DEFAULT NULL,
  52. `act_user_name` varchar(255) DEFAULT NULL,
  53. `repo_id` bigint(20) DEFAULT NULL,
  54. `repo_user_name` varchar(255) DEFAULT NULL,
  55. `repo_name` varchar(255) DEFAULT NULL,
  56. `ref_name` varchar(255) DEFAULT NULL,
  57. `is_private` tinyint(1) NOT NULL DEFAULT '0',
  58. `content` text,
  59. `created_unix` bigint(20) DEFAULT NULL
  60. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  61. --
  62. -- Dumping data for table `action`
  63. --
  64. INSERT INTO `action` (`id`, `user_id`, `op_type`, `act_user_id`, `act_user_name`, `repo_id`, `repo_user_name`, `repo_name`, `ref_name`, `is_private`, `content`, `created_unix`) VALUES
  65. (1, 1, 1, 1, 'admin1', 1, 'admin1', 'sh', '', 0, '', 1650520679),
  66. (2, 1, 5, 1, 'admin1', 1, 'admin1', 'sh', 'master', 0, '{\"Len\":1,\"Commits\":[{\"Sha1\":\"63356f1021d32243fbb0a8904c7044ddaf6fa8cf\",\"Message\":\"Add \'coffeesystem.sh\'\\n\",\"AuthorEmail\":\"admin@yahoo.com\",\"AuthorName\":\"admin1\",\"CommitterEmail\":\"admin@yahoo.com\",\"CommitterName\":\"admin1\",\"Timestamp\":\"2022-04-20T23:18:07-07:00\"}],\"CompareURL\":\"admin1/sh/compare/752762ee93104e7ead471fb9ddc22e84b6390342...63356f1021d32243fbb0a8904c7044ddaf6fa8cf\"}', 1650521887),
  67. (3, 1, 1, 1, 'admin1', 2, 'admin1', 'Coffee_MySQL', '', 0, '', 1651039547),
  68. (4, 1, 5, 1, 'admin1', 2, 'admin1', 'Coffee_MySQL', 'master', 0, '{\"Len\":1,\"Commits\":[{\"Sha1\":\"b9f2fcde94ad62e0e7e4c11b0eb24961231177b2\",\"Message\":\"Upload files to \'\'\\n\",\"AuthorEmail\":\"admin@yahoo.com\",\"AuthorName\":\"admin1\",\"CommitterEmail\":\"admin@yahoo.com\",\"CommitterName\":\"admin1\",\"Timestamp\":\"2022-04-26T23:05:56-07:00\"}],\"CompareURL\":\"admin1/Coffee_MySQL/compare/1891b50957fe806a2bcafeb70059da3c3fcb3d6d...b9f2fcde94ad62e0e7e4c11b0eb24961231177b2\"}', 1651039556),
  69. (7, 1, 1, 1, 'admin1', 4, 'admin1', 'CoffeeProject', '', 0, '', 1651039813),
  70. (8, 1, 5, 1, 'admin1', 4, 'admin1', 'CoffeeProject', 'master', 0, '{\"Len\":1,\"Commits\":[{\"Sha1\":\"cbe56b6f6ead1500dcc173c84cd798d8c6818992\",\"Message\":\"Upload files to \'app\'\\n\",\"AuthorEmail\":\"admin@yahoo.com\",\"AuthorName\":\"admin1\",\"CommitterEmail\":\"admin@yahoo.com\",\"CommitterName\":\"admin1\",\"Timestamp\":\"2022-04-26T23:10:39-07:00\"}],\"CompareURL\":\"admin1/CoffeeProject/compare/1ea43fe520a92deea883951cc3fa12a8e646320e...cbe56b6f6ead1500dcc173c84cd798d8c6818992\"}', 1651039840),
  71. (9, 1, 5, 1, 'admin1', 4, 'admin1', 'CoffeeProject', 'master', 0, '{\"Len\":1,\"Commits\":[{\"Sha1\":\"3c2760209ec7dbed4aaa56f864ad5b906d6a56c8\",\"Message\":\"Upload files to \'venv\'\\n\",\"AuthorEmail\":\"admin@yahoo.com\",\"AuthorName\":\"admin1\",\"CommitterEmail\":\"admin@yahoo.com\",\"CommitterName\":\"admin1\",\"Timestamp\":\"2022-04-26T23:15:51-07:00\"}],\"CompareURL\":\"admin1/CoffeeProject/compare/cbe56b6f6ead1500dcc173c84cd798d8c6818992...3c2760209ec7dbed4aaa56f864ad5b906d6a56c8\"}', 1651040154),
  72. (10, 1, 5, 1, 'admin1', 4, 'admin1', 'CoffeeProject', 'master', 0, '{\"Len\":1,\"Commits\":[{\"Sha1\":\"c887ee437a2b47ba55f5646c89fef6b5f61c0e1a\",\"Message\":\"Upload files to \'\'\\n\",\"AuthorEmail\":\"admin@yahoo.com\",\"AuthorName\":\"admin1\",\"CommitterEmail\":\"admin@yahoo.com\",\"CommitterName\":\"admin1\",\"Timestamp\":\"2022-04-26T23:16:06-07:00\"}],\"CompareURL\":\"admin1/CoffeeProject/compare/3c2760209ec7dbed4aaa56f864ad5b906d6a56c8...c887ee437a2b47ba55f5646c89fef6b5f61c0e1a\"}', 1651040166),
  73. (12, 1, 1, 1, 'admin1', 6, 'admin1', 'Automatically_install_files', '', 0, '', 1651040233),
  74. (13, 1, 5, 1, 'admin1', 6, 'admin1', 'Automatically_install_files', 'master', 0, '{\"Len\":1,\"Commits\":[{\"Sha1\":\"b8d26c605f5370a4c9f791d39917348e594d58ea\",\"Message\":\"Upload files to \'\'\\n\",\"AuthorEmail\":\"admin@yahoo.com\",\"AuthorName\":\"admin1\",\"CommitterEmail\":\"admin@yahoo.com\",\"CommitterName\":\"admin1\",\"Timestamp\":\"2022-04-26T23:17:20-07:00\"}],\"CompareURL\":\"admin1/Automatically_install_files/compare/eec9a5486ac533eed1008aa8c8a72b98c2d64b99...b8d26c605f5370a4c9f791d39917348e594d58ea\"}', 1651040240),
  75. (14, 1, 1, 1, 'admin1', 7, 'admin1', 'git_mysql', '', 0, '', 1651040262),
  76. (15, 1, 5, 1, 'admin1', 7, 'admin1', 'git_mysql', 'master', 0, '{\"Len\":1,\"Commits\":[{\"Sha1\":\"3d018e3e6b08d985573b81844a947689c4a567b1\",\"Message\":\"Upload files to \'\'\\n\",\"AuthorEmail\":\"admin@yahoo.com\",\"AuthorName\":\"admin1\",\"CommitterEmail\":\"admin@yahoo.com\",\"CommitterName\":\"admin1\",\"Timestamp\":\"2022-04-26T23:17:49-07:00\"}],\"CompareURL\":\"admin1/git_mysql/compare/88d4ae7841d5f22cf0bcc81ab686764384b847db...3d018e3e6b08d985573b81844a947689c4a567b1\"}', 1651040269),
  77. (16, 1, 1, 1, 'admin1', 8, 'admin1', 'gogsfile', '', 0, '', 1651040294),
  78. (17, 1, 5, 1, 'admin1', 8, 'admin1', 'gogsfile', 'master', 0, '{\"Len\":1,\"Commits\":[{\"Sha1\":\"151f0b4c9d9963251ead142caa4ceba6d467aaf3\",\"Message\":\"Upload files to \'\'\\n\",\"AuthorEmail\":\"admin@yahoo.com\",\"AuthorName\":\"admin1\",\"CommitterEmail\":\"admin@yahoo.com\",\"CommitterName\":\"admin1\",\"Timestamp\":\"2022-04-26T23:18:25-07:00\"}],\"CompareURL\":\"admin1/gogsfile/compare/ffa744ba6be1f942e41ddc80df14b608a40f75bf...151f0b4c9d9963251ead142caa4ceba6d467aaf3\"}', 1651040308),
  79. (18, 1, 1, 1, 'admin1', 9, 'admin1', 'mqtt_server_setting', '', 0, '', 1651040324),
  80. (19, 1, 5, 1, 'admin1', 9, 'admin1', 'mqtt_server_setting', 'master', 0, '{\"Len\":1,\"Commits\":[{\"Sha1\":\"ee73fea1805b6fcca1f8437cd4acc8e53bf7c1c4\",\"Message\":\"Upload files to \'\'\\n\",\"AuthorEmail\":\"admin@yahoo.com\",\"AuthorName\":\"admin1\",\"CommitterEmail\":\"admin@yahoo.com\",\"CommitterName\":\"admin1\",\"Timestamp\":\"2022-04-26T23:18:51-07:00\"}],\"CompareURL\":\"admin1/mqtt_server_setting/compare/4fcc1ba857f18409f4352e386f31ecb6964bec6c...ee73fea1805b6fcca1f8437cd4acc8e53bf7c1c4\"}', 1651040331),
  81. (20, 1, 1, 1, 'admin1', 10, 'admin1', 'proc', '', 0, '', 1651040348),
  82. (21, 1, 5, 1, 'admin1', 10, 'admin1', 'proc', 'master', 0, '{\"Len\":1,\"Commits\":[{\"Sha1\":\"3003ec06b47589c655fd983ad06ce86e7c0271b6\",\"Message\":\"Upload files to \'\'\\n\",\"AuthorEmail\":\"admin@yahoo.com\",\"AuthorName\":\"admin1\",\"CommitterEmail\":\"admin@yahoo.com\",\"CommitterName\":\"admin1\",\"Timestamp\":\"2022-04-26T23:19:18-07:00\"}],\"CompareURL\":\"admin1/proc/compare/21fd98d2576fa2c91043a9b8e73910e79eabae13...3003ec06b47589c655fd983ad06ce86e7c0271b6\"}', 1651040358),
  83. (22, 1, 5, 1, 'admin1', 9, 'admin1', 'mqtt_server_setting', 'master', 0, '{\"Len\":1,\"Commits\":[{\"Sha1\":\"cc87de17ed9f670ebb8f12258a72239e160dd1ef\",\"Message\":\"Upload files to \'\'\\n\",\"AuthorEmail\":\"admin@yahoo.com\",\"AuthorName\":\"admin1\",\"CommitterEmail\":\"admin@yahoo.com\",\"CommitterName\":\"admin1\",\"Timestamp\":\"2022-04-27T00:34:07-07:00\"}],\"CompareURL\":\"admin1/mqtt_server_setting/compare/ee73fea1805b6fcca1f8437cd4acc8e53bf7c1c4...cc87de17ed9f670ebb8f12258a72239e160dd1ef\"}', 1651044847),
  84. (23, 1, 1, 1, 'admin1', 11, 'admin1', 'BBend-Test-JWT', '', 0, '', 1651044862),
  85. (24, 1, 5, 1, 'admin1', 11, 'admin1', 'BBend-Test-JWT', 'master', 0, '{\"Len\":1,\"Commits\":[{\"Sha1\":\"a94199362aab3877123edf91f8559c07e48ea3fa\",\"Message\":\"Upload files to \'app\'\\n\",\"AuthorEmail\":\"admin@yahoo.com\",\"AuthorName\":\"admin1\",\"CommitterEmail\":\"admin@yahoo.com\",\"CommitterName\":\"admin1\",\"Timestamp\":\"2022-04-27T00:34:38-07:00\"}],\"CompareURL\":\"admin1/BBend-Test-JWT/compare/82fd1363f6befffb47eadae3b3f9dcd6c964965e...a94199362aab3877123edf91f8559c07e48ea3fa\"}', 1651044879),
  86. (25, 1, 5, 1, 'admin1', 11, 'admin1', 'BBend-Test-JWT', 'master', 0, '{\"Len\":1,\"Commits\":[{\"Sha1\":\"1f5d50bc72a6390152038e8a45f868f187347753\",\"Message\":\"Upload files to \'venv\'\\n\",\"AuthorEmail\":\"admin@yahoo.com\",\"AuthorName\":\"admin1\",\"CommitterEmail\":\"admin@yahoo.com\",\"CommitterName\":\"admin1\",\"Timestamp\":\"2022-04-27T00:37:24-07:00\"}],\"CompareURL\":\"admin1/BBend-Test-JWT/compare/a94199362aab3877123edf91f8559c07e48ea3fa...1f5d50bc72a6390152038e8a45f868f187347753\"}', 1651045048),
  87. (26, 1, 5, 1, 'admin1', 11, 'admin1', 'BBend-Test-JWT', 'master', 0, '{\"Len\":1,\"Commits\":[{\"Sha1\":\"2776ba5149d43abf464c57bf764273c1b486ccdf\",\"Message\":\"Upload files to \'\'\\n\",\"AuthorEmail\":\"admin@yahoo.com\",\"AuthorName\":\"admin1\",\"CommitterEmail\":\"admin@yahoo.com\",\"CommitterName\":\"admin1\",\"Timestamp\":\"2022-04-27T00:37:45-07:00\"}],\"CompareURL\":\"admin1/BBend-Test-JWT/compare/1f5d50bc72a6390152038e8a45f868f187347753...2776ba5149d43abf464c57bf764273c1b486ccdf\"}', 1651045065),
  88. (27, 1, 5, 1, 'admin1', 1, 'admin1', 'sh', 'master', 0, '{\"Len\":1,\"Commits\":[{\"Sha1\":\"54fced058b4b75a900788dc993c2b0cdd555499e\",\"Message\":\"Update \'coffeesystem.sh\'\\n\",\"AuthorEmail\":\"admin@yahoo.com\",\"AuthorName\":\"admin1\",\"CommitterEmail\":\"admin@yahoo.com\",\"CommitterName\":\"admin1\",\"Timestamp\":\"2022-04-27T00:53:20-07:00\"}],\"CompareURL\":\"admin1/sh/compare/63356f1021d32243fbb0a8904c7044ddaf6fa8cf...54fced058b4b75a900788dc993c2b0cdd555499e\"}', 1651046000);
  89. -- --------------------------------------------------------
  90. --
  91. -- Table structure for table `attachment`
  92. --
  93. CREATE TABLE `attachment` (
  94. `id` bigint(20) NOT NULL,
  95. `uuid` varchar(40) DEFAULT NULL,
  96. `issue_id` bigint(20) DEFAULT NULL,
  97. `comment_id` bigint(20) DEFAULT NULL,
  98. `release_id` bigint(20) DEFAULT NULL,
  99. `name` varchar(255) DEFAULT NULL,
  100. `created_unix` bigint(20) DEFAULT NULL
  101. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  102. -- --------------------------------------------------------
  103. --
  104. -- Table structure for table `collaboration`
  105. --
  106. CREATE TABLE `collaboration` (
  107. `id` bigint(20) NOT NULL,
  108. `repo_id` bigint(20) NOT NULL,
  109. `user_id` bigint(20) NOT NULL,
  110. `mode` int(11) NOT NULL DEFAULT '2'
  111. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  112. -- --------------------------------------------------------
  113. --
  114. -- Table structure for table `comment`
  115. --
  116. CREATE TABLE `comment` (
  117. `id` bigint(20) NOT NULL,
  118. `type` int(11) DEFAULT NULL,
  119. `poster_id` bigint(20) DEFAULT NULL,
  120. `issue_id` bigint(20) DEFAULT NULL,
  121. `commit_id` bigint(20) DEFAULT NULL,
  122. `line` bigint(20) DEFAULT NULL,
  123. `content` text,
  124. `created_unix` bigint(20) DEFAULT NULL,
  125. `updated_unix` bigint(20) DEFAULT NULL,
  126. `commit_sha` varchar(40) DEFAULT NULL
  127. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  128. -- --------------------------------------------------------
  129. --
  130. -- Table structure for table `deploy_key`
  131. --
  132. CREATE TABLE `deploy_key` (
  133. `id` bigint(20) NOT NULL,
  134. `key_id` bigint(20) DEFAULT NULL,
  135. `repo_id` bigint(20) DEFAULT NULL,
  136. `name` varchar(255) DEFAULT NULL,
  137. `fingerprint` varchar(255) DEFAULT NULL,
  138. `created_unix` bigint(20) DEFAULT NULL,
  139. `updated_unix` bigint(20) DEFAULT NULL
  140. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  141. -- --------------------------------------------------------
  142. --
  143. -- Table structure for table `email_address`
  144. --
  145. CREATE TABLE `email_address` (
  146. `id` bigint(20) NOT NULL,
  147. `uid` bigint(20) NOT NULL,
  148. `email` varchar(255) NOT NULL,
  149. `is_activated` tinyint(1) DEFAULT NULL
  150. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  151. -- --------------------------------------------------------
  152. --
  153. -- Table structure for table `follow`
  154. --
  155. CREATE TABLE `follow` (
  156. `id` bigint(20) NOT NULL,
  157. `user_id` bigint(20) DEFAULT NULL,
  158. `follow_id` bigint(20) DEFAULT NULL
  159. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  160. -- --------------------------------------------------------
  161. --
  162. -- Table structure for table `hook_task`
  163. --
  164. CREATE TABLE `hook_task` (
  165. `id` bigint(20) NOT NULL,
  166. `repo_id` bigint(20) DEFAULT NULL,
  167. `hook_id` bigint(20) DEFAULT NULL,
  168. `uuid` varchar(255) DEFAULT NULL,
  169. `type` int(11) DEFAULT NULL,
  170. `url` text,
  171. `signature` text,
  172. `payload_content` text,
  173. `content_type` int(11) DEFAULT NULL,
  174. `event_type` varchar(255) DEFAULT NULL,
  175. `is_ssl` tinyint(1) DEFAULT NULL,
  176. `is_delivered` tinyint(1) DEFAULT NULL,
  177. `delivered` bigint(20) DEFAULT NULL,
  178. `is_succeed` tinyint(1) DEFAULT NULL,
  179. `request_content` text,
  180. `response_content` text
  181. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  182. -- --------------------------------------------------------
  183. --
  184. -- Table structure for table `issue`
  185. --
  186. CREATE TABLE `issue` (
  187. `id` bigint(20) NOT NULL,
  188. `repo_id` bigint(20) DEFAULT NULL,
  189. `index` bigint(20) DEFAULT NULL,
  190. `poster_id` bigint(20) DEFAULT NULL,
  191. `name` varchar(255) DEFAULT NULL,
  192. `content` text,
  193. `milestone_id` bigint(20) DEFAULT NULL,
  194. `priority` int(11) DEFAULT NULL,
  195. `assignee_id` bigint(20) DEFAULT NULL,
  196. `is_closed` tinyint(1) DEFAULT NULL,
  197. `is_pull` tinyint(1) DEFAULT NULL,
  198. `num_comments` int(11) DEFAULT NULL,
  199. `deadline_unix` bigint(20) DEFAULT NULL,
  200. `created_unix` bigint(20) DEFAULT NULL,
  201. `updated_unix` bigint(20) DEFAULT NULL
  202. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  203. -- --------------------------------------------------------
  204. --
  205. -- Table structure for table `issue_label`
  206. --
  207. CREATE TABLE `issue_label` (
  208. `id` bigint(20) NOT NULL,
  209. `issue_id` bigint(20) DEFAULT NULL,
  210. `label_id` bigint(20) DEFAULT NULL
  211. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  212. -- --------------------------------------------------------
  213. --
  214. -- Table structure for table `issue_user`
  215. --
  216. CREATE TABLE `issue_user` (
  217. `id` bigint(20) NOT NULL,
  218. `uid` bigint(20) DEFAULT NULL,
  219. `issue_id` bigint(20) DEFAULT NULL,
  220. `repo_id` bigint(20) DEFAULT NULL,
  221. `milestone_id` bigint(20) DEFAULT NULL,
  222. `is_read` tinyint(1) DEFAULT NULL,
  223. `is_assigned` tinyint(1) DEFAULT NULL,
  224. `is_mentioned` tinyint(1) DEFAULT NULL,
  225. `is_poster` tinyint(1) DEFAULT NULL,
  226. `is_closed` tinyint(1) DEFAULT NULL
  227. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  228. -- --------------------------------------------------------
  229. --
  230. -- Table structure for table `label`
  231. --
  232. CREATE TABLE `label` (
  233. `id` bigint(20) NOT NULL,
  234. `repo_id` bigint(20) DEFAULT NULL,
  235. `name` varchar(255) DEFAULT NULL,
  236. `color` varchar(7) DEFAULT NULL,
  237. `num_issues` int(11) DEFAULT NULL,
  238. `num_closed_issues` int(11) DEFAULT NULL
  239. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  240. -- --------------------------------------------------------
  241. --
  242. -- Table structure for table `lfs_object`
  243. --
  244. CREATE TABLE `lfs_object` (
  245. `repo_id` bigint(20) NOT NULL,
  246. `oid` varchar(255) NOT NULL,
  247. `size` bigint(20) NOT NULL,
  248. `storage` varchar(255) NOT NULL,
  249. `created_at` datetime NOT NULL
  250. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  251. -- --------------------------------------------------------
  252. --
  253. -- Table structure for table `login_source`
  254. --
  255. CREATE TABLE `login_source` (
  256. `id` bigint(20) NOT NULL,
  257. `type` int(11) DEFAULT NULL,
  258. `name` varchar(255) DEFAULT NULL,
  259. `is_actived` tinyint(1) NOT NULL,
  260. `is_default` tinyint(1) DEFAULT NULL,
  261. `cfg` text,
  262. `created_unix` bigint(20) DEFAULT NULL,
  263. `updated_unix` bigint(20) DEFAULT NULL
  264. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  265. -- --------------------------------------------------------
  266. --
  267. -- Table structure for table `milestone`
  268. --
  269. CREATE TABLE `milestone` (
  270. `id` bigint(20) NOT NULL,
  271. `repo_id` bigint(20) DEFAULT NULL,
  272. `name` varchar(255) DEFAULT NULL,
  273. `content` text,
  274. `is_closed` tinyint(1) DEFAULT NULL,
  275. `num_issues` int(11) DEFAULT NULL,
  276. `num_closed_issues` int(11) DEFAULT NULL,
  277. `completeness` int(11) DEFAULT NULL,
  278. `deadline_unix` bigint(20) DEFAULT NULL,
  279. `closed_date_unix` bigint(20) DEFAULT NULL
  280. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  281. -- --------------------------------------------------------
  282. --
  283. -- Table structure for table `mirror`
  284. --
  285. CREATE TABLE `mirror` (
  286. `id` bigint(20) NOT NULL,
  287. `repo_id` bigint(20) DEFAULT NULL,
  288. `interval` int(11) DEFAULT NULL,
  289. `enable_prune` tinyint(1) NOT NULL DEFAULT '1',
  290. `updated_unix` bigint(20) DEFAULT NULL,
  291. `next_update_unix` bigint(20) DEFAULT NULL
  292. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  293. -- --------------------------------------------------------
  294. --
  295. -- Table structure for table `notice`
  296. --
  297. CREATE TABLE `notice` (
  298. `id` bigint(20) NOT NULL,
  299. `type` int(11) DEFAULT NULL,
  300. `description` text,
  301. `created_unix` bigint(20) DEFAULT NULL
  302. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  303. -- --------------------------------------------------------
  304. --
  305. -- Table structure for table `org_user`
  306. --
  307. CREATE TABLE `org_user` (
  308. `id` bigint(20) NOT NULL,
  309. `uid` bigint(20) DEFAULT NULL,
  310. `org_id` bigint(20) DEFAULT NULL,
  311. `is_public` tinyint(1) DEFAULT NULL,
  312. `is_owner` tinyint(1) DEFAULT NULL,
  313. `num_teams` int(11) DEFAULT NULL
  314. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  315. -- --------------------------------------------------------
  316. --
  317. -- Table structure for table `protect_branch`
  318. --
  319. CREATE TABLE `protect_branch` (
  320. `id` bigint(20) NOT NULL,
  321. `repo_id` bigint(20) DEFAULT NULL,
  322. `name` varchar(255) DEFAULT NULL,
  323. `protected` tinyint(1) DEFAULT NULL,
  324. `require_pull_request` tinyint(1) DEFAULT NULL,
  325. `enable_whitelist` tinyint(1) DEFAULT NULL,
  326. `whitelist_user_i_ds` text,
  327. `whitelist_team_i_ds` text
  328. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  329. -- --------------------------------------------------------
  330. --
  331. -- Table structure for table `protect_branch_whitelist`
  332. --
  333. CREATE TABLE `protect_branch_whitelist` (
  334. `id` bigint(20) NOT NULL,
  335. `protect_branch_id` bigint(20) DEFAULT NULL,
  336. `repo_id` bigint(20) DEFAULT NULL,
  337. `name` varchar(255) DEFAULT NULL,
  338. `user_id` bigint(20) DEFAULT NULL
  339. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  340. -- --------------------------------------------------------
  341. --
  342. -- Table structure for table `public_key`
  343. --
  344. CREATE TABLE `public_key` (
  345. `id` bigint(20) NOT NULL,
  346. `owner_id` bigint(20) NOT NULL,
  347. `name` varchar(255) NOT NULL,
  348. `fingerprint` varchar(255) NOT NULL,
  349. `content` text NOT NULL,
  350. `mode` int(11) NOT NULL DEFAULT '2',
  351. `type` int(11) NOT NULL DEFAULT '1',
  352. `created_unix` bigint(20) DEFAULT NULL,
  353. `updated_unix` bigint(20) DEFAULT NULL
  354. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  355. -- --------------------------------------------------------
  356. --
  357. -- Table structure for table `pull_request`
  358. --
  359. CREATE TABLE `pull_request` (
  360. `id` bigint(20) NOT NULL,
  361. `type` int(11) DEFAULT NULL,
  362. `status` int(11) DEFAULT NULL,
  363. `issue_id` bigint(20) DEFAULT NULL,
  364. `index` bigint(20) DEFAULT NULL,
  365. `head_repo_id` bigint(20) DEFAULT NULL,
  366. `base_repo_id` bigint(20) DEFAULT NULL,
  367. `head_user_name` varchar(255) DEFAULT NULL,
  368. `head_branch` varchar(255) DEFAULT NULL,
  369. `base_branch` varchar(255) DEFAULT NULL,
  370. `merge_base` varchar(40) DEFAULT NULL,
  371. `has_merged` tinyint(1) DEFAULT NULL,
  372. `merged_commit_id` varchar(40) DEFAULT NULL,
  373. `merger_id` bigint(20) DEFAULT NULL,
  374. `merged_unix` bigint(20) DEFAULT NULL
  375. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  376. -- --------------------------------------------------------
  377. --
  378. -- Table structure for table `release`
  379. --
  380. CREATE TABLE `release` (
  381. `id` bigint(20) NOT NULL,
  382. `repo_id` bigint(20) DEFAULT NULL,
  383. `publisher_id` bigint(20) DEFAULT NULL,
  384. `tag_name` varchar(255) DEFAULT NULL,
  385. `lower_tag_name` varchar(255) DEFAULT NULL,
  386. `target` varchar(255) DEFAULT NULL,
  387. `title` varchar(255) DEFAULT NULL,
  388. `sha1` varchar(40) DEFAULT NULL,
  389. `num_commits` bigint(20) DEFAULT NULL,
  390. `note` text,
  391. `is_draft` tinyint(1) NOT NULL DEFAULT '0',
  392. `is_prerelease` tinyint(1) DEFAULT NULL,
  393. `created_unix` bigint(20) DEFAULT NULL
  394. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  395. -- --------------------------------------------------------
  396. --
  397. -- Table structure for table `repository`
  398. --
  399. CREATE TABLE `repository` (
  400. `id` bigint(20) NOT NULL,
  401. `owner_id` bigint(20) DEFAULT NULL,
  402. `lower_name` varchar(255) NOT NULL,
  403. `name` varchar(255) NOT NULL,
  404. `description` varchar(512) DEFAULT NULL,
  405. `website` varchar(255) DEFAULT NULL,
  406. `default_branch` varchar(255) DEFAULT NULL,
  407. `size` bigint(20) NOT NULL DEFAULT '0',
  408. `use_custom_avatar` tinyint(1) DEFAULT NULL,
  409. `num_watches` int(11) DEFAULT NULL,
  410. `num_stars` int(11) DEFAULT NULL,
  411. `num_forks` int(11) DEFAULT NULL,
  412. `num_issues` int(11) DEFAULT NULL,
  413. `num_closed_issues` int(11) DEFAULT NULL,
  414. `num_pulls` int(11) DEFAULT NULL,
  415. `num_closed_pulls` int(11) DEFAULT NULL,
  416. `num_milestones` int(11) NOT NULL DEFAULT '0',
  417. `num_closed_milestones` int(11) NOT NULL DEFAULT '0',
  418. `is_private` tinyint(1) DEFAULT NULL,
  419. `is_bare` tinyint(1) DEFAULT NULL,
  420. `is_mirror` tinyint(1) DEFAULT NULL,
  421. `enable_wiki` tinyint(1) NOT NULL DEFAULT '1',
  422. `allow_public_wiki` tinyint(1) DEFAULT NULL,
  423. `enable_external_wiki` tinyint(1) DEFAULT NULL,
  424. `external_wiki_url` varchar(255) DEFAULT NULL,
  425. `enable_issues` tinyint(1) NOT NULL DEFAULT '1',
  426. `allow_public_issues` tinyint(1) DEFAULT NULL,
  427. `enable_external_tracker` tinyint(1) DEFAULT NULL,
  428. `external_tracker_url` varchar(255) DEFAULT NULL,
  429. `external_tracker_format` varchar(255) DEFAULT NULL,
  430. `external_tracker_style` varchar(255) DEFAULT NULL,
  431. `enable_pulls` tinyint(1) NOT NULL DEFAULT '1',
  432. `pulls_ignore_whitespace` tinyint(1) NOT NULL DEFAULT '0',
  433. `pulls_allow_rebase` tinyint(1) NOT NULL DEFAULT '0',
  434. `is_fork` tinyint(1) NOT NULL DEFAULT '0',
  435. `fork_id` bigint(20) DEFAULT NULL,
  436. `created_unix` bigint(20) DEFAULT NULL,
  437. `updated_unix` bigint(20) DEFAULT NULL
  438. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  439. --
  440. -- Dumping data for table `repository`
  441. --
  442. INSERT INTO `repository` (`id`, `owner_id`, `lower_name`, `name`, `description`, `website`, `default_branch`, `size`, `use_custom_avatar`, `num_watches`, `num_stars`, `num_forks`, `num_issues`, `num_closed_issues`, `num_pulls`, `num_closed_pulls`, `num_milestones`, `num_closed_milestones`, `is_private`, `is_bare`, `is_mirror`, `enable_wiki`, `allow_public_wiki`, `enable_external_wiki`, `external_wiki_url`, `enable_issues`, `allow_public_issues`, `enable_external_tracker`, `external_tracker_url`, `external_tracker_format`, `external_tracker_style`, `enable_pulls`, `pulls_ignore_whitespace`, `pulls_allow_rebase`, `is_fork`, `fork_id`, `created_unix`, `updated_unix`) VALUES
  443. (1, 1, 'sh', 'sh', '', '', 'master', 36864, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, '', 1, 0, 0, '', '', 'numeric', 1, 0, 0, 0, 0, 1650520679, 1651046000),
  444. (2, 1, 'coffee_mysql', 'Coffee_MySQL', '', '', 'master', 24576, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, '', 1, 0, 0, '', '', 'numeric', 1, 0, 0, 0, 0, 1651039547, 1651039556),
  445. (4, 1, 'coffeeproject', 'CoffeeProject', '', '', 'master', 16501760, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, '', 1, 0, 0, '', '', 'numeric', 1, 0, 0, 0, 0, 1651039813, 1651040166),
  446. (6, 1, 'automatically_install_files', 'Automatically_install_files', '', '', 'master', 24576, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, '', 1, 0, 0, '', '', 'numeric', 1, 0, 0, 0, 0, 1651040233, 1651040240),
  447. (7, 1, 'git_mysql', 'git_mysql', '', '', 'master', 28672, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, '', 1, 0, 0, '', '', 'numeric', 1, 0, 0, 0, 0, 1651040262, 1651040269),
  448. (8, 1, 'gogsfile', 'gogsfile', '', '', 'master', 27377664, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, '', 1, 0, 0, '', '', 'numeric', 1, 0, 0, 0, 0, 1651040294, 1651040308),
  449. (9, 1, 'mqtt_server_setting', 'mqtt_server_setting', '', '', 'master', 49152, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, '', 1, 0, 0, '', '', 'numeric', 1, 0, 0, 0, 0, 1651040324, 1651044847),
  450. (10, 1, 'proc', 'proc', '', '', 'master', 32768, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, '', 1, 0, 0, '', '', 'numeric', 1, 0, 0, 0, 0, 1651040348, 1651040358),
  451. (11, 1, 'bbend-test-jwt', 'BBend-Test-JWT', '', '', 'master', 16340992, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, '', 1, 0, 0, '', '', 'numeric', 1, 0, 0, 0, 0, 1651044862, 1651045065);
  452. -- --------------------------------------------------------
  453. --
  454. -- Table structure for table `star`
  455. --
  456. CREATE TABLE `star` (
  457. `id` bigint(20) NOT NULL,
  458. `uid` bigint(20) DEFAULT NULL,
  459. `repo_id` bigint(20) DEFAULT NULL
  460. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  461. -- --------------------------------------------------------
  462. --
  463. -- Table structure for table `team`
  464. --
  465. CREATE TABLE `team` (
  466. `id` bigint(20) NOT NULL,
  467. `org_id` bigint(20) DEFAULT NULL,
  468. `lower_name` varchar(255) DEFAULT NULL,
  469. `name` varchar(255) DEFAULT NULL,
  470. `description` varchar(255) DEFAULT NULL,
  471. `authorize` int(11) DEFAULT NULL,
  472. `num_repos` int(11) DEFAULT NULL,
  473. `num_members` int(11) DEFAULT NULL
  474. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  475. -- --------------------------------------------------------
  476. --
  477. -- Table structure for table `team_repo`
  478. --
  479. CREATE TABLE `team_repo` (
  480. `id` bigint(20) NOT NULL,
  481. `org_id` bigint(20) DEFAULT NULL,
  482. `team_id` bigint(20) DEFAULT NULL,
  483. `repo_id` bigint(20) DEFAULT NULL
  484. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  485. -- --------------------------------------------------------
  486. --
  487. -- Table structure for table `team_user`
  488. --
  489. CREATE TABLE `team_user` (
  490. `id` bigint(20) NOT NULL,
  491. `org_id` bigint(20) DEFAULT NULL,
  492. `team_id` bigint(20) DEFAULT NULL,
  493. `uid` bigint(20) DEFAULT NULL
  494. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  495. -- --------------------------------------------------------
  496. --
  497. -- Table structure for table `two_factor`
  498. --
  499. CREATE TABLE `two_factor` (
  500. `id` bigint(20) NOT NULL,
  501. `user_id` bigint(20) DEFAULT NULL,
  502. `secret` varchar(255) DEFAULT NULL,
  503. `created_unix` bigint(20) DEFAULT NULL
  504. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  505. -- --------------------------------------------------------
  506. --
  507. -- Table structure for table `two_factor_recovery_code`
  508. --
  509. CREATE TABLE `two_factor_recovery_code` (
  510. `id` bigint(20) NOT NULL,
  511. `user_id` bigint(20) DEFAULT NULL,
  512. `code` varchar(11) DEFAULT NULL,
  513. `is_used` tinyint(1) DEFAULT NULL
  514. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  515. -- --------------------------------------------------------
  516. --
  517. -- Table structure for table `upload`
  518. --
  519. CREATE TABLE `upload` (
  520. `id` bigint(20) NOT NULL,
  521. `uuid` varchar(40) DEFAULT NULL,
  522. `name` varchar(255) DEFAULT NULL
  523. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  524. -- --------------------------------------------------------
  525. --
  526. -- Table structure for table `user`
  527. --
  528. CREATE TABLE `user` (
  529. `id` bigint(20) NOT NULL,
  530. `lower_name` varchar(255) NOT NULL,
  531. `name` varchar(255) NOT NULL,
  532. `full_name` varchar(255) DEFAULT NULL,
  533. `email` varchar(255) NOT NULL,
  534. `passwd` varchar(255) NOT NULL,
  535. `login_source` bigint(20) NOT NULL DEFAULT '0',
  536. `login_name` varchar(255) DEFAULT NULL,
  537. `type` int(11) DEFAULT NULL,
  538. `location` varchar(255) DEFAULT NULL,
  539. `website` varchar(255) DEFAULT NULL,
  540. `rands` varchar(10) DEFAULT NULL,
  541. `salt` varchar(10) DEFAULT NULL,
  542. `created_unix` bigint(20) DEFAULT NULL,
  543. `updated_unix` bigint(20) DEFAULT NULL,
  544. `last_repo_visibility` tinyint(1) DEFAULT NULL,
  545. `max_repo_creation` int(11) NOT NULL DEFAULT '-1',
  546. `is_active` tinyint(1) DEFAULT NULL,
  547. `is_admin` tinyint(1) DEFAULT NULL,
  548. `allow_git_hook` tinyint(1) DEFAULT NULL,
  549. `allow_import_local` tinyint(1) DEFAULT NULL,
  550. `prohibit_login` tinyint(1) DEFAULT NULL,
  551. `avatar` varchar(2048) NOT NULL,
  552. `avatar_email` varchar(255) NOT NULL,
  553. `use_custom_avatar` tinyint(1) DEFAULT NULL,
  554. `num_followers` int(11) DEFAULT NULL,
  555. `num_following` int(11) NOT NULL DEFAULT '0',
  556. `num_stars` int(11) DEFAULT NULL,
  557. `num_repos` int(11) DEFAULT NULL,
  558. `description` varchar(255) DEFAULT NULL,
  559. `num_teams` int(11) DEFAULT NULL,
  560. `num_members` int(11) DEFAULT NULL
  561. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  562. --
  563. -- Dumping data for table `user`
  564. --
  565. INSERT INTO `user` (`id`, `lower_name`, `name`, `full_name`, `email`, `passwd`, `login_source`, `login_name`, `type`, `location`, `website`, `rands`, `salt`, `created_unix`, `updated_unix`, `last_repo_visibility`, `max_repo_creation`, `is_active`, `is_admin`, `allow_git_hook`, `allow_import_local`, `prohibit_login`, `avatar`, `avatar_email`, `use_custom_avatar`, `num_followers`, `num_following`, `num_stars`, `num_repos`, `description`, `num_teams`, `num_members`) VALUES
  566. (1, 'admin1', 'admin1', '', 'admin@yahoo.com', '28ce87da20d032905f2792f55d8e6df28cff94e0dcf39e568c93d9b7cccf2bda81d741dc9bdf6a79e6ccb713c0f57fbc2cf2', 0, '', 0, '', '', 'XSMaeibCnL', '0G0bfeo07q', 1650520634, 1651044862, 0, -1, 1, 1, 0, 0, 0, '3325b3371681e9381a2c8610f34aaae7', 'admin@yahoo.com', 0, 0, 0, 0, 9, '', 0, 0);
  567. -- --------------------------------------------------------
  568. --
  569. -- Table structure for table `version`
  570. --
  571. CREATE TABLE `version` (
  572. `id` bigint(20) NOT NULL,
  573. `version` bigint(20) DEFAULT NULL
  574. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  575. --
  576. -- Dumping data for table `version`
  577. --
  578. INSERT INTO `version` (`id`, `version`) VALUES
  579. (1, 19);
  580. -- --------------------------------------------------------
  581. --
  582. -- Table structure for table `watch`
  583. --
  584. CREATE TABLE `watch` (
  585. `id` bigint(20) NOT NULL,
  586. `user_id` bigint(20) DEFAULT NULL,
  587. `repo_id` bigint(20) DEFAULT NULL
  588. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  589. --
  590. -- Dumping data for table `watch`
  591. --
  592. INSERT INTO `watch` (`id`, `user_id`, `repo_id`) VALUES
  593. (1, 1, 1),
  594. (2, 1, 2),
  595. (4, 1, 4),
  596. (6, 1, 6),
  597. (7, 1, 7),
  598. (8, 1, 8),
  599. (9, 1, 9),
  600. (10, 1, 10),
  601. (11, 1, 11);
  602. -- --------------------------------------------------------
  603. --
  604. -- Table structure for table `webhook`
  605. --
  606. CREATE TABLE `webhook` (
  607. `id` bigint(20) NOT NULL,
  608. `repo_id` bigint(20) DEFAULT NULL,
  609. `org_id` bigint(20) DEFAULT NULL,
  610. `url` text,
  611. `content_type` int(11) DEFAULT NULL,
  612. `secret` text,
  613. `events` text,
  614. `is_ssl` tinyint(1) DEFAULT NULL,
  615. `is_active` tinyint(1) DEFAULT NULL,
  616. `hook_task_type` int(11) DEFAULT NULL,
  617. `meta` text,
  618. `last_status` int(11) DEFAULT NULL,
  619. `created_unix` bigint(20) DEFAULT NULL,
  620. `updated_unix` bigint(20) DEFAULT NULL
  621. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
  622. --
  623. -- Indexes for dumped tables
  624. --
  625. --
  626. -- Indexes for table `access`
  627. --
  628. ALTER TABLE `access`
  629. ADD PRIMARY KEY (`id`),
  630. ADD UNIQUE KEY `UQE_access_s` (`user_id`,`repo_id`);
  631. --
  632. -- Indexes for table `access_token`
  633. --
  634. ALTER TABLE `access_token`
  635. ADD PRIMARY KEY (`id`),
  636. ADD UNIQUE KEY `sha1` (`sha1`),
  637. ADD KEY `idx_access_token_uid` (`uid`);
  638. --
  639. -- Indexes for table `action`
  640. --
  641. ALTER TABLE `action`
  642. ADD PRIMARY KEY (`id`),
  643. ADD KEY `IDX_action_repo_id` (`repo_id`);
  644. --
  645. -- Indexes for table `attachment`
  646. --
  647. ALTER TABLE `attachment`
  648. ADD PRIMARY KEY (`id`),
  649. ADD UNIQUE KEY `UQE_attachment_uuid` (`uuid`),
  650. ADD KEY `IDX_attachment_issue_id` (`issue_id`),
  651. ADD KEY `IDX_attachment_release_id` (`release_id`);
  652. --
  653. -- Indexes for table `collaboration`
  654. --
  655. ALTER TABLE `collaboration`
  656. ADD PRIMARY KEY (`id`),
  657. ADD UNIQUE KEY `UQE_collaboration_s` (`repo_id`,`user_id`),
  658. ADD KEY `IDX_collaboration_repo_id` (`repo_id`),
  659. ADD KEY `IDX_collaboration_user_id` (`user_id`);
  660. --
  661. -- Indexes for table `comment`
  662. --
  663. ALTER TABLE `comment`
  664. ADD PRIMARY KEY (`id`),
  665. ADD KEY `IDX_comment_issue_id` (`issue_id`);
  666. --
  667. -- Indexes for table `deploy_key`
  668. --
  669. ALTER TABLE `deploy_key`
  670. ADD PRIMARY KEY (`id`),
  671. ADD UNIQUE KEY `UQE_deploy_key_s` (`key_id`,`repo_id`),
  672. ADD KEY `IDX_deploy_key_key_id` (`key_id`),
  673. ADD KEY `IDX_deploy_key_repo_id` (`repo_id`);
  674. --
  675. -- Indexes for table `email_address`
  676. --
  677. ALTER TABLE `email_address`
  678. ADD PRIMARY KEY (`id`),
  679. ADD UNIQUE KEY `UQE_email_address_email` (`email`),
  680. ADD KEY `IDX_email_address_uid` (`uid`);
  681. --
  682. -- Indexes for table `follow`
  683. --
  684. ALTER TABLE `follow`
  685. ADD PRIMARY KEY (`id`),
  686. ADD UNIQUE KEY `UQE_follow_follow` (`user_id`,`follow_id`);
  687. --
  688. -- Indexes for table `hook_task`
  689. --
  690. ALTER TABLE `hook_task`
  691. ADD PRIMARY KEY (`id`),
  692. ADD KEY `IDX_hook_task_repo_id` (`repo_id`);
  693. --
  694. -- Indexes for table `issue`
  695. --
  696. ALTER TABLE `issue`
  697. ADD PRIMARY KEY (`id`),
  698. ADD UNIQUE KEY `UQE_issue_repo_index` (`repo_id`,`index`),
  699. ADD KEY `IDX_issue_repo_id` (`repo_id`);
  700. --
  701. -- Indexes for table `issue_label`
  702. --
  703. ALTER TABLE `issue_label`
  704. ADD PRIMARY KEY (`id`),
  705. ADD UNIQUE KEY `UQE_issue_label_s` (`issue_id`,`label_id`);
  706. --
  707. -- Indexes for table `issue_user`
  708. --
  709. ALTER TABLE `issue_user`
  710. ADD PRIMARY KEY (`id`),
  711. ADD KEY `IDX_issue_user_uid` (`uid`),
  712. ADD KEY `IDX_issue_user_repo_id` (`repo_id`);
  713. --
  714. -- Indexes for table `label`
  715. --
  716. ALTER TABLE `label`
  717. ADD PRIMARY KEY (`id`),
  718. ADD KEY `IDX_label_repo_id` (`repo_id`);
  719. --
  720. -- Indexes for table `lfs_object`
  721. --
  722. ALTER TABLE `lfs_object`
  723. ADD PRIMARY KEY (`repo_id`,`oid`);
  724. --
  725. -- Indexes for table `login_source`
  726. --
  727. ALTER TABLE `login_source`
  728. ADD PRIMARY KEY (`id`),
  729. ADD UNIQUE KEY `name` (`name`);
  730. --
  731. -- Indexes for table `milestone`
  732. --
  733. ALTER TABLE `milestone`
  734. ADD PRIMARY KEY (`id`),
  735. ADD KEY `IDX_milestone_repo_id` (`repo_id`);
  736. --
  737. -- Indexes for table `mirror`
  738. --
  739. ALTER TABLE `mirror`
  740. ADD PRIMARY KEY (`id`);
  741. --
  742. -- Indexes for table `notice`
  743. --
  744. ALTER TABLE `notice`
  745. ADD PRIMARY KEY (`id`);
  746. --
  747. -- Indexes for table `org_user`
  748. --
  749. ALTER TABLE `org_user`
  750. ADD PRIMARY KEY (`id`),
  751. ADD UNIQUE KEY `UQE_org_user_s` (`uid`,`org_id`),
  752. ADD KEY `IDX_org_user_uid` (`uid`),
  753. ADD KEY `IDX_org_user_org_id` (`org_id`);
  754. --
  755. -- Indexes for table `protect_branch`
  756. --
  757. ALTER TABLE `protect_branch`
  758. ADD PRIMARY KEY (`id`),
  759. ADD UNIQUE KEY `UQE_protect_branch_protect_branch` (`repo_id`,`name`);
  760. --
  761. -- Indexes for table `protect_branch_whitelist`
  762. --
  763. ALTER TABLE `protect_branch_whitelist`
  764. ADD PRIMARY KEY (`id`),
  765. ADD UNIQUE KEY `UQE_protect_branch_whitelist_protect_branch_whitelist` (`repo_id`,`name`,`user_id`);
  766. --
  767. -- Indexes for table `public_key`
  768. --
  769. ALTER TABLE `public_key`
  770. ADD PRIMARY KEY (`id`),
  771. ADD KEY `IDX_public_key_owner_id` (`owner_id`);
  772. --
  773. -- Indexes for table `pull_request`
  774. --
  775. ALTER TABLE `pull_request`
  776. ADD PRIMARY KEY (`id`),
  777. ADD KEY `IDX_pull_request_issue_id` (`issue_id`);
  778. --
  779. -- Indexes for table `release`
  780. --
  781. ALTER TABLE `release`
  782. ADD PRIMARY KEY (`id`);
  783. --
  784. -- Indexes for table `repository`
  785. --
  786. ALTER TABLE `repository`
  787. ADD PRIMARY KEY (`id`),
  788. ADD UNIQUE KEY `UQE_repository_s` (`owner_id`,`lower_name`),
  789. ADD KEY `IDX_repository_lower_name` (`lower_name`),
  790. ADD KEY `IDX_repository_name` (`name`);
  791. --
  792. -- Indexes for table `star`
  793. --
  794. ALTER TABLE `star`
  795. ADD PRIMARY KEY (`id`),
  796. ADD UNIQUE KEY `UQE_star_s` (`uid`,`repo_id`);
  797. --
  798. -- Indexes for table `team`
  799. --
  800. ALTER TABLE `team`
  801. ADD PRIMARY KEY (`id`),
  802. ADD KEY `IDX_team_org_id` (`org_id`);
  803. --
  804. -- Indexes for table `team_repo`
  805. --
  806. ALTER TABLE `team_repo`
  807. ADD PRIMARY KEY (`id`),
  808. ADD UNIQUE KEY `UQE_team_repo_s` (`team_id`,`repo_id`),
  809. ADD KEY `IDX_team_repo_org_id` (`org_id`);
  810. --
  811. -- Indexes for table `team_user`
  812. --
  813. ALTER TABLE `team_user`
  814. ADD PRIMARY KEY (`id`),
  815. ADD UNIQUE KEY `UQE_team_user_s` (`team_id`,`uid`),
  816. ADD KEY `IDX_team_user_org_id` (`org_id`);
  817. --
  818. -- Indexes for table `two_factor`
  819. --
  820. ALTER TABLE `two_factor`
  821. ADD PRIMARY KEY (`id`),
  822. ADD UNIQUE KEY `UQE_two_factor_user_id` (`user_id`);
  823. --
  824. -- Indexes for table `two_factor_recovery_code`
  825. --
  826. ALTER TABLE `two_factor_recovery_code`
  827. ADD PRIMARY KEY (`id`);
  828. --
  829. -- Indexes for table `upload`
  830. --
  831. ALTER TABLE `upload`
  832. ADD PRIMARY KEY (`id`),
  833. ADD UNIQUE KEY `UQE_upload_uuid` (`uuid`);
  834. --
  835. -- Indexes for table `user`
  836. --
  837. ALTER TABLE `user`
  838. ADD PRIMARY KEY (`id`),
  839. ADD UNIQUE KEY `UQE_user_lower_name` (`lower_name`),
  840. ADD UNIQUE KEY `UQE_user_name` (`name`);
  841. --
  842. -- Indexes for table `version`
  843. --
  844. ALTER TABLE `version`
  845. ADD PRIMARY KEY (`id`);
  846. --
  847. -- Indexes for table `watch`
  848. --
  849. ALTER TABLE `watch`
  850. ADD PRIMARY KEY (`id`),
  851. ADD UNIQUE KEY `UQE_watch_watch` (`user_id`,`repo_id`);
  852. --
  853. -- Indexes for table `webhook`
  854. --
  855. ALTER TABLE `webhook`
  856. ADD PRIMARY KEY (`id`);
  857. --
  858. -- AUTO_INCREMENT for dumped tables
  859. --
  860. --
  861. -- AUTO_INCREMENT for table `access`
  862. --
  863. ALTER TABLE `access`
  864. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  865. --
  866. -- AUTO_INCREMENT for table `access_token`
  867. --
  868. ALTER TABLE `access_token`
  869. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  870. --
  871. -- AUTO_INCREMENT for table `action`
  872. --
  873. ALTER TABLE `action`
  874. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28;
  875. --
  876. -- AUTO_INCREMENT for table `attachment`
  877. --
  878. ALTER TABLE `attachment`
  879. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  880. --
  881. -- AUTO_INCREMENT for table `collaboration`
  882. --
  883. ALTER TABLE `collaboration`
  884. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  885. --
  886. -- AUTO_INCREMENT for table `comment`
  887. --
  888. ALTER TABLE `comment`
  889. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  890. --
  891. -- AUTO_INCREMENT for table `deploy_key`
  892. --
  893. ALTER TABLE `deploy_key`
  894. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  895. --
  896. -- AUTO_INCREMENT for table `email_address`
  897. --
  898. ALTER TABLE `email_address`
  899. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  900. --
  901. -- AUTO_INCREMENT for table `follow`
  902. --
  903. ALTER TABLE `follow`
  904. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  905. --
  906. -- AUTO_INCREMENT for table `hook_task`
  907. --
  908. ALTER TABLE `hook_task`
  909. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  910. --
  911. -- AUTO_INCREMENT for table `issue`
  912. --
  913. ALTER TABLE `issue`
  914. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  915. --
  916. -- AUTO_INCREMENT for table `issue_label`
  917. --
  918. ALTER TABLE `issue_label`
  919. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  920. --
  921. -- AUTO_INCREMENT for table `issue_user`
  922. --
  923. ALTER TABLE `issue_user`
  924. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  925. --
  926. -- AUTO_INCREMENT for table `label`
  927. --
  928. ALTER TABLE `label`
  929. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  930. --
  931. -- AUTO_INCREMENT for table `login_source`
  932. --
  933. ALTER TABLE `login_source`
  934. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  935. --
  936. -- AUTO_INCREMENT for table `milestone`
  937. --
  938. ALTER TABLE `milestone`
  939. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  940. --
  941. -- AUTO_INCREMENT for table `mirror`
  942. --
  943. ALTER TABLE `mirror`
  944. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  945. --
  946. -- AUTO_INCREMENT for table `notice`
  947. --
  948. ALTER TABLE `notice`
  949. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  950. --
  951. -- AUTO_INCREMENT for table `org_user`
  952. --
  953. ALTER TABLE `org_user`
  954. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  955. --
  956. -- AUTO_INCREMENT for table `protect_branch`
  957. --
  958. ALTER TABLE `protect_branch`
  959. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  960. --
  961. -- AUTO_INCREMENT for table `protect_branch_whitelist`
  962. --
  963. ALTER TABLE `protect_branch_whitelist`
  964. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  965. --
  966. -- AUTO_INCREMENT for table `public_key`
  967. --
  968. ALTER TABLE `public_key`
  969. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  970. --
  971. -- AUTO_INCREMENT for table `pull_request`
  972. --
  973. ALTER TABLE `pull_request`
  974. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  975. --
  976. -- AUTO_INCREMENT for table `release`
  977. --
  978. ALTER TABLE `release`
  979. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  980. --
  981. -- AUTO_INCREMENT for table `repository`
  982. --
  983. ALTER TABLE `repository`
  984. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
  985. --
  986. -- AUTO_INCREMENT for table `star`
  987. --
  988. ALTER TABLE `star`
  989. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  990. --
  991. -- AUTO_INCREMENT for table `team`
  992. --
  993. ALTER TABLE `team`
  994. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  995. --
  996. -- AUTO_INCREMENT for table `team_repo`
  997. --
  998. ALTER TABLE `team_repo`
  999. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  1000. --
  1001. -- AUTO_INCREMENT for table `team_user`
  1002. --
  1003. ALTER TABLE `team_user`
  1004. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  1005. --
  1006. -- AUTO_INCREMENT for table `two_factor`
  1007. --
  1008. ALTER TABLE `two_factor`
  1009. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  1010. --
  1011. -- AUTO_INCREMENT for table `two_factor_recovery_code`
  1012. --
  1013. ALTER TABLE `two_factor_recovery_code`
  1014. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  1015. --
  1016. -- AUTO_INCREMENT for table `upload`
  1017. --
  1018. ALTER TABLE `upload`
  1019. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4747;
  1020. --
  1021. -- AUTO_INCREMENT for table `user`
  1022. --
  1023. ALTER TABLE `user`
  1024. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  1025. --
  1026. -- AUTO_INCREMENT for table `version`
  1027. --
  1028. ALTER TABLE `version`
  1029. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
  1030. --
  1031. -- AUTO_INCREMENT for table `watch`
  1032. --
  1033. ALTER TABLE `watch`
  1034. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
  1035. --
  1036. -- AUTO_INCREMENT for table `webhook`
  1037. --
  1038. ALTER TABLE `webhook`
  1039. MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
  1040. COMMIT;
  1041. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  1042. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  1043. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;