mattermost-postgresql-5.0.sql 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818
  1. --
  2. -- PostgreSQL database dump
  3. --
  4. SET statement_timeout = 0;
  5. SET lock_timeout = 0;
  6. SET client_encoding = 'UTF8';
  7. SET standard_conforming_strings = on;
  8. SELECT pg_catalog.set_config('search_path', '', false);
  9. SET check_function_bodies = false;
  10. SET client_min_messages = warning;
  11. --
  12. -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
  13. --
  14. CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
  15. --
  16. -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
  17. --
  18. COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
  19. SET default_tablespace = '';
  20. SET default_with_oids = false;
  21. --
  22. -- Name: audits; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  23. --
  24. CREATE TABLE public.audits (
  25. id character varying(26) NOT NULL,
  26. createat bigint,
  27. userid character varying(26),
  28. action character varying(512),
  29. extrainfo character varying(1024),
  30. ipaddress character varying(64),
  31. sessionid character varying(26)
  32. );
  33. ALTER TABLE public.audits OWNER TO mmuser;
  34. --
  35. -- Name: channelmemberhistory; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  36. --
  37. CREATE TABLE public.channelmemberhistory (
  38. channelid character varying(26) NOT NULL,
  39. userid character varying(26) NOT NULL,
  40. jointime bigint NOT NULL,
  41. leavetime bigint
  42. );
  43. ALTER TABLE public.channelmemberhistory OWNER TO mmuser;
  44. --
  45. -- Name: channelmembers; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  46. --
  47. CREATE TABLE public.channelmembers (
  48. channelid character varying(26) NOT NULL,
  49. userid character varying(26) NOT NULL,
  50. roles character varying(64),
  51. lastviewedat bigint,
  52. msgcount bigint,
  53. mentioncount bigint,
  54. notifyprops character varying(2000),
  55. lastupdateat bigint,
  56. schemeuser boolean,
  57. schemeadmin boolean
  58. );
  59. ALTER TABLE public.channelmembers OWNER TO mmuser;
  60. --
  61. -- Name: channels; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  62. --
  63. CREATE TABLE public.channels (
  64. id character varying(26) NOT NULL,
  65. createat bigint,
  66. updateat bigint,
  67. deleteat bigint,
  68. teamid character varying(26),
  69. type character varying(1),
  70. displayname character varying(64),
  71. name character varying(64),
  72. header character varying(1024),
  73. purpose character varying(250),
  74. lastpostat bigint,
  75. totalmsgcount bigint,
  76. extraupdateat bigint,
  77. creatorid character varying(26),
  78. schemeid character varying(26)
  79. );
  80. ALTER TABLE public.channels OWNER TO mmuser;
  81. --
  82. -- Name: clusterdiscovery; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  83. --
  84. CREATE TABLE public.clusterdiscovery (
  85. id character varying(26) NOT NULL,
  86. type character varying(64),
  87. clustername character varying(64),
  88. hostname character varying(512),
  89. gossipport integer,
  90. port integer,
  91. createat bigint,
  92. lastpingat bigint
  93. );
  94. ALTER TABLE public.clusterdiscovery OWNER TO mmuser;
  95. --
  96. -- Name: commands; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  97. --
  98. CREATE TABLE public.commands (
  99. id character varying(26) NOT NULL,
  100. token character varying(26),
  101. createat bigint,
  102. updateat bigint,
  103. deleteat bigint,
  104. creatorid character varying(26),
  105. teamid character varying(26),
  106. trigger character varying(128),
  107. method character varying(1),
  108. username character varying(64),
  109. iconurl character varying(1024),
  110. autocomplete boolean,
  111. autocompletedesc character varying(1024),
  112. autocompletehint character varying(1024),
  113. displayname character varying(64),
  114. description character varying(128),
  115. url character varying(1024)
  116. );
  117. ALTER TABLE public.commands OWNER TO mmuser;
  118. --
  119. -- Name: commandwebhooks; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  120. --
  121. CREATE TABLE public.commandwebhooks (
  122. id character varying(26) NOT NULL,
  123. createat bigint,
  124. commandid character varying(26),
  125. userid character varying(26),
  126. channelid character varying(26),
  127. rootid character varying(26),
  128. parentid character varying(26),
  129. usecount integer
  130. );
  131. ALTER TABLE public.commandwebhooks OWNER TO mmuser;
  132. --
  133. -- Name: compliances; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  134. --
  135. CREATE TABLE public.compliances (
  136. id character varying(26) NOT NULL,
  137. createat bigint,
  138. userid character varying(26),
  139. status character varying(64),
  140. count integer,
  141. "desc" character varying(512),
  142. type character varying(64),
  143. startat bigint,
  144. endat bigint,
  145. keywords character varying(512),
  146. emails character varying(1024)
  147. );
  148. ALTER TABLE public.compliances OWNER TO mmuser;
  149. --
  150. -- Name: emoji; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  151. --
  152. CREATE TABLE public.emoji (
  153. id character varying(26) NOT NULL,
  154. createat bigint,
  155. updateat bigint,
  156. deleteat bigint,
  157. creatorid character varying(26),
  158. name character varying(64)
  159. );
  160. ALTER TABLE public.emoji OWNER TO mmuser;
  161. --
  162. -- Name: fileinfo; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  163. --
  164. CREATE TABLE public.fileinfo (
  165. id character varying(26) NOT NULL,
  166. creatorid character varying(26),
  167. postid character varying(26),
  168. createat bigint,
  169. updateat bigint,
  170. deleteat bigint,
  171. path character varying(512),
  172. thumbnailpath character varying(512),
  173. previewpath character varying(512),
  174. name character varying(256),
  175. extension character varying(64),
  176. size bigint,
  177. mimetype character varying(256),
  178. width integer,
  179. height integer,
  180. haspreviewimage boolean
  181. );
  182. ALTER TABLE public.fileinfo OWNER TO mmuser;
  183. --
  184. -- Name: incomingwebhooks; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  185. --
  186. CREATE TABLE public.incomingwebhooks (
  187. id character varying(26) NOT NULL,
  188. createat bigint,
  189. updateat bigint,
  190. deleteat bigint,
  191. userid character varying(26),
  192. channelid character varying(26),
  193. teamid character varying(26),
  194. displayname character varying(64),
  195. description character varying(128),
  196. username text,
  197. iconurl text,
  198. channellocked boolean
  199. );
  200. ALTER TABLE public.incomingwebhooks OWNER TO mmuser;
  201. --
  202. -- Name: jobs; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  203. --
  204. CREATE TABLE public.jobs (
  205. id character varying(26) NOT NULL,
  206. type character varying(32),
  207. priority bigint,
  208. createat bigint,
  209. startat bigint,
  210. lastactivityat bigint,
  211. status character varying(32),
  212. progress bigint,
  213. data character varying(1024)
  214. );
  215. ALTER TABLE public.jobs OWNER TO mmuser;
  216. --
  217. -- Name: licenses; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  218. --
  219. CREATE TABLE public.licenses (
  220. id character varying(26) NOT NULL,
  221. createat bigint,
  222. bytes character varying(10000)
  223. );
  224. ALTER TABLE public.licenses OWNER TO mmuser;
  225. --
  226. -- Name: oauthaccessdata; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  227. --
  228. CREATE TABLE public.oauthaccessdata (
  229. clientid character varying(26),
  230. userid character varying(26),
  231. token character varying(26) NOT NULL,
  232. refreshtoken character varying(26),
  233. redirecturi character varying(256),
  234. expiresat bigint,
  235. scope character varying(128)
  236. );
  237. ALTER TABLE public.oauthaccessdata OWNER TO mmuser;
  238. --
  239. -- Name: oauthapps; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  240. --
  241. CREATE TABLE public.oauthapps (
  242. id character varying(26) NOT NULL,
  243. creatorid character varying(26),
  244. createat bigint,
  245. updateat bigint,
  246. clientsecret character varying(128),
  247. name character varying(64),
  248. description character varying(512),
  249. iconurl character varying(512),
  250. callbackurls character varying(1024),
  251. homepage character varying(256),
  252. istrusted boolean
  253. );
  254. ALTER TABLE public.oauthapps OWNER TO mmuser;
  255. --
  256. -- Name: oauthauthdata; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  257. --
  258. CREATE TABLE public.oauthauthdata (
  259. clientid character varying(26),
  260. userid character varying(26),
  261. code character varying(128) NOT NULL,
  262. expiresin integer,
  263. createat bigint,
  264. redirecturi character varying(256),
  265. state character varying(1024),
  266. scope character varying(128)
  267. );
  268. ALTER TABLE public.oauthauthdata OWNER TO mmuser;
  269. --
  270. -- Name: outgoingwebhooks; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  271. --
  272. CREATE TABLE public.outgoingwebhooks (
  273. id character varying(26) NOT NULL,
  274. token character varying(26),
  275. createat bigint,
  276. updateat bigint,
  277. deleteat bigint,
  278. creatorid character varying(26),
  279. channelid character varying(26),
  280. teamid character varying(26),
  281. triggerwords character varying(1024),
  282. triggerwhen integer,
  283. callbackurls character varying(1024),
  284. displayname character varying(64),
  285. description character varying(128),
  286. contenttype character varying(128)
  287. );
  288. ALTER TABLE public.outgoingwebhooks OWNER TO mmuser;
  289. --
  290. -- Name: pluginkeyvaluestore; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  291. --
  292. CREATE TABLE public.pluginkeyvaluestore (
  293. pluginid character varying(190) NOT NULL,
  294. pkey character varying(50) NOT NULL,
  295. pvalue bytea
  296. );
  297. ALTER TABLE public.pluginkeyvaluestore OWNER TO mmuser;
  298. --
  299. -- Name: posts; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  300. --
  301. CREATE TABLE public.posts (
  302. id character varying(26) NOT NULL,
  303. createat bigint,
  304. updateat bigint,
  305. editat bigint,
  306. deleteat bigint,
  307. ispinned boolean,
  308. userid character varying(26),
  309. channelid character varying(26),
  310. rootid character varying(26),
  311. parentid character varying(26),
  312. originalid character varying(26),
  313. message character varying(65535),
  314. type character varying(26),
  315. props character varying(8000),
  316. hashtags character varying(1000),
  317. filenames character varying(4000),
  318. fileids character varying(150),
  319. hasreactions boolean
  320. );
  321. ALTER TABLE public.posts OWNER TO mmuser;
  322. --
  323. -- Name: preferences; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  324. --
  325. CREATE TABLE public.preferences (
  326. userid character varying(26) NOT NULL,
  327. category character varying(32) NOT NULL,
  328. name character varying(32) NOT NULL,
  329. value character varying(2000)
  330. );
  331. ALTER TABLE public.preferences OWNER TO mmuser;
  332. --
  333. -- Name: reactions; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  334. --
  335. CREATE TABLE public.reactions (
  336. userid character varying(26) NOT NULL,
  337. postid character varying(26) NOT NULL,
  338. emojiname character varying(64) NOT NULL,
  339. createat bigint
  340. );
  341. ALTER TABLE public.reactions OWNER TO mmuser;
  342. --
  343. -- Name: roles; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  344. --
  345. CREATE TABLE public.roles (
  346. id character varying(26) NOT NULL,
  347. name character varying(64),
  348. displayname character varying(128),
  349. description character varying(1024),
  350. createat bigint,
  351. updateat bigint,
  352. deleteat bigint,
  353. permissions character varying(4096),
  354. schememanaged boolean,
  355. builtin boolean
  356. );
  357. ALTER TABLE public.roles OWNER TO mmuser;
  358. --
  359. -- Name: schemes; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  360. --
  361. CREATE TABLE public.schemes (
  362. id character varying(26) NOT NULL,
  363. name character varying(64),
  364. displayname character varying(128),
  365. description character varying(1024),
  366. createat bigint,
  367. updateat bigint,
  368. deleteat bigint,
  369. scope character varying(32),
  370. defaultteamadminrole character varying(64),
  371. defaultteamuserrole character varying(64),
  372. defaultchanneladminrole character varying(64),
  373. defaultchanneluserrole character varying(64)
  374. );
  375. ALTER TABLE public.schemes OWNER TO mmuser;
  376. --
  377. -- Name: sessions; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  378. --
  379. CREATE TABLE public.sessions (
  380. id character varying(26) NOT NULL,
  381. token character varying(26),
  382. createat bigint,
  383. expiresat bigint,
  384. lastactivityat bigint,
  385. userid character varying(26),
  386. deviceid character varying(512),
  387. roles character varying(64),
  388. isoauth boolean,
  389. expirednotify boolean,
  390. props character varying(1000),
  391. );
  392. ALTER TABLE public.sessions OWNER TO mmuser;
  393. --
  394. -- Name: status; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  395. --
  396. CREATE TABLE public.status (
  397. userid character varying(26) NOT NULL,
  398. status character varying(32),
  399. manual boolean,
  400. lastactivityat bigint
  401. );
  402. ALTER TABLE public.status OWNER TO mmuser;
  403. --
  404. -- Name: systems; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  405. --
  406. CREATE TABLE public.systems (
  407. name character varying(64) NOT NULL,
  408. value character varying(1024)
  409. );
  410. ALTER TABLE public.systems OWNER TO mmuser;
  411. --
  412. -- Name: teammembers; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  413. --
  414. CREATE TABLE public.teammembers (
  415. teamid character varying(26) NOT NULL,
  416. userid character varying(26) NOT NULL,
  417. roles character varying(64),
  418. deleteat bigint,
  419. schemeuser boolean,
  420. schemeadmin boolean
  421. );
  422. ALTER TABLE public.teammembers OWNER TO mmuser;
  423. --
  424. -- Name: teams; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  425. --
  426. CREATE TABLE public.teams (
  427. id character varying(26) NOT NULL,
  428. createat bigint,
  429. updateat bigint,
  430. deleteat bigint,
  431. displayname character varying(64),
  432. name character varying(64),
  433. description character varying(255),
  434. email character varying(128),
  435. type text,
  436. companyname character varying(64),
  437. alloweddomains character varying(500),
  438. inviteid character varying(32),
  439. allowopeninvite boolean,
  440. lastteamiconupdate bigint,
  441. schemeid text
  442. );
  443. ALTER TABLE public.teams OWNER TO mmuser;
  444. --
  445. -- Name: tokens; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  446. --
  447. CREATE TABLE public.tokens (
  448. token character varying(64) NOT NULL,
  449. createat bigint,
  450. type character varying(64),
  451. extra character varying(128)
  452. );
  453. ALTER TABLE public.tokens OWNER TO mmuser;
  454. --
  455. -- Name: useraccesstokens; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  456. --
  457. CREATE TABLE public.useraccesstokens (
  458. id character varying(26) NOT NULL,
  459. token character varying(26),
  460. userid character varying(26),
  461. description character varying(512),
  462. isactive boolean
  463. );
  464. ALTER TABLE public.useraccesstokens OWNER TO mmuser;
  465. --
  466. -- Name: users; Type: TABLE; Schema: public; Owner: mmuser; Tablespace:
  467. --
  468. CREATE TABLE public.users (
  469. id character varying(26) NOT NULL,
  470. createat bigint,
  471. updateat bigint,
  472. deleteat bigint,
  473. username character varying(64),
  474. password character varying(128),
  475. authdata character varying(128),
  476. authservice character varying(32),
  477. email character varying(128),
  478. emailverified boolean,
  479. nickname character varying(64),
  480. firstname character varying(64),
  481. lastname character varying(64),
  482. "position" character varying(128),
  483. roles character varying(256),
  484. allowmarketing boolean,
  485. props character varying(4000),
  486. notifyprops character varying(2000),
  487. lastpasswordupdate bigint,
  488. lastpictureupdate bigint,
  489. failedattempts integer,
  490. locale character varying(5),
  491. timezone character varying(256),
  492. mfaactive boolean,
  493. mfasecret character varying(128)
  494. );
  495. ALTER TABLE public.users OWNER TO mmuser;
  496. --
  497. -- Data for Name: audits; Type: TABLE DATA; Schema: public; Owner: mmuser
  498. --
  499. COPY public.audits (id, createat, userid, action, extrainfo, ipaddress, sessionid) FROM stdin;
  500. \.
  501. --
  502. -- Data for Name: channelmemberhistory; Type: TABLE DATA; Schema: public; Owner: mmuser
  503. --
  504. COPY public.channelmemberhistory (channelid, userid, jointime, leavetime) FROM stdin;
  505. \.
  506. --
  507. -- Data for Name: channelmembers; Type: TABLE DATA; Schema: public; Owner: mmuser
  508. --
  509. COPY public.channelmembers (channelid, userid, roles, lastviewedat, msgcount, mentioncount, notifyprops, lastupdateat, schemeuser, schemeadmin) FROM stdin;
  510. \.
  511. --
  512. -- Data for Name: channels; Type: TABLE DATA; Schema: public; Owner: mmuser
  513. --
  514. COPY public.channels (id, createat, updateat, deleteat, teamid, type, displayname, name, header, purpose, lastpostat, totalmsgcount, extraupdateat, creatorid, schemeid) FROM stdin;
  515. \.
  516. --
  517. -- Data for Name: clusterdiscovery; Type: TABLE DATA; Schema: public; Owner: mmuser
  518. --
  519. COPY public.clusterdiscovery (id, type, clustername, hostname, gossipport, port, createat, lastpingat) FROM stdin;
  520. \.
  521. --
  522. -- Data for Name: commands; Type: TABLE DATA; Schema: public; Owner: mmuser
  523. --
  524. COPY public.commands (id, token, createat, updateat, deleteat, creatorid, teamid, trigger, method, username, iconurl, autocomplete, autocompletedesc, autocompletehint, displayname, description, url) FROM stdin;
  525. \.
  526. --
  527. -- Data for Name: commandwebhooks; Type: TABLE DATA; Schema: public; Owner: mmuser
  528. --
  529. COPY public.commandwebhooks (id, createat, commandid, userid, channelid, rootid, parentid, usecount) FROM stdin;
  530. \.
  531. --
  532. -- Data for Name: compliances; Type: TABLE DATA; Schema: public; Owner: mmuser
  533. --
  534. COPY public.compliances (id, createat, userid, status, count, "desc", type, startat, endat, keywords, emails) FROM stdin;
  535. \.
  536. --
  537. -- Data for Name: emoji; Type: TABLE DATA; Schema: public; Owner: mmuser
  538. --
  539. COPY public.emoji (id, createat, updateat, deleteat, creatorid, name) FROM stdin;
  540. \.
  541. --
  542. -- Data for Name: fileinfo; Type: TABLE DATA; Schema: public; Owner: mmuser
  543. --
  544. COPY public.fileinfo (id, creatorid, postid, createat, updateat, deleteat, path, thumbnailpath, previewpath, name, extension, size, mimetype, width, height, haspreviewimage) FROM stdin;
  545. \.
  546. --
  547. -- Data for Name: incomingwebhooks; Type: TABLE DATA; Schema: public; Owner: mmuser
  548. --
  549. COPY public.incomingwebhooks (id, createat, updateat, deleteat, userid, channelid, teamid, displayname, description, username, iconurl, channellocked) FROM stdin;
  550. \.
  551. --
  552. -- Data for Name: jobs; Type: TABLE DATA; Schema: public; Owner: mmuser
  553. --
  554. COPY public.jobs (id, type, priority, createat, startat, lastactivityat, status, progress, data) FROM stdin;
  555. \.
  556. --
  557. -- Data for Name: licenses; Type: TABLE DATA; Schema: public; Owner: mmuser
  558. --
  559. COPY public.licenses (id, createat, bytes) FROM stdin;
  560. \.
  561. --
  562. -- Data for Name: oauthaccessdata; Type: TABLE DATA; Schema: public; Owner: mmuser
  563. --
  564. COPY public.oauthaccessdata (clientid, userid, token, refreshtoken, redirecturi, expiresat, scope) FROM stdin;
  565. \.
  566. --
  567. -- Data for Name: oauthapps; Type: TABLE DATA; Schema: public; Owner: mmuser
  568. --
  569. COPY public.oauthapps (id, creatorid, createat, updateat, clientsecret, name, description, iconurl, callbackurls, homepage, istrusted) FROM stdin;
  570. \.
  571. --
  572. -- Data for Name: oauthauthdata; Type: TABLE DATA; Schema: public; Owner: mmuser
  573. --
  574. COPY public.oauthauthdata (clientid, userid, code, expiresin, createat, redirecturi, state, scope) FROM stdin;
  575. \.
  576. --
  577. -- Data for Name: outgoingwebhooks; Type: TABLE DATA; Schema: public; Owner: mmuser
  578. --
  579. COPY public.outgoingwebhooks (id, token, createat, updateat, deleteat, creatorid, channelid, teamid, triggerwords, triggerwhen, callbackurls, displayname, description, contenttype) FROM stdin;
  580. \.
  581. --
  582. -- Data for Name: pluginkeyvaluestore; Type: TABLE DATA; Schema: public; Owner: mmuser
  583. --
  584. COPY public.pluginkeyvaluestore (pluginid, pkey, pvalue) FROM stdin;
  585. \.
  586. --
  587. -- Data for Name: posts; Type: TABLE DATA; Schema: public; Owner: mmuser
  588. --
  589. COPY public.posts (id, createat, updateat, editat, deleteat, ispinned, userid, channelid, rootid, parentid, originalid, message, type, props, hashtags, filenames, fileids, hasreactions) FROM stdin;
  590. \.
  591. --
  592. -- Data for Name: preferences; Type: TABLE DATA; Schema: public; Owner: mmuser
  593. --
  594. COPY public.preferences (userid, category, name, value) FROM stdin;
  595. \.
  596. --
  597. -- Data for Name: reactions; Type: TABLE DATA; Schema: public; Owner: mmuser
  598. --
  599. COPY public.reactions (userid, postid, emojiname, createat) FROM stdin;
  600. \.
  601. --
  602. -- Data for Name: roles; Type: TABLE DATA; Schema: public; Owner: mmuser
  603. --
  604. COPY public.roles (id, name, displayname, description, createat, updateat, deleteat, permissions, schememanaged, builtin) FROM stdin;
  605. aap88jdt37dgdgkek1c7dq69ua team_post_all authentication.roles.team_post_all.name authentication.roles.team_post_all.description 1552912816230 1552912816230 0 create_post f t
  606. masesduwobn95dqoyba5xmtz5o team_post_all_public authentication.roles.team_post_all_public.name authentication.roles.team_post_all_public.description 1552912816258 1552912816258 0 create_post_public f t
  607. ufy3o8h1y3g4bgqeyw7yb6hrwe system_post_all authentication.roles.system_post_all.name authentication.roles.system_post_all.description 1552912816269 1552912816269 0 create_post f t
  608. 7ptq38iy4br59q8y4zt9mm3zwy system_post_all_public authentication.roles.system_post_all_public.name authentication.roles.system_post_all_public.description 1552912816288 1552912816288 0 create_post_public f t
  609. wpxrpuiyo3bgdf34u7t65gcota system_user_access_token authentication.roles.system_user_access_token.name authentication.roles.system_user_access_token.description 1552912816404 1552912816404 0 create_user_access_token read_user_access_token revoke_user_access_token f t
  610. fomn851ie3gmz8zwr87szazm6w channel_user authentication.roles.channel_user.name authentication.roles.channel_user.description 1552912816614 1552912816614 0 read_channel add_reaction remove_reaction manage_public_channel_members upload_file get_public_link create_post use_slash_commands manage_private_channel_members delete_post edit_post t t
  611. xjxw3p6ect8bjfre7wc5jhwbqr channel_admin authentication.roles.channel_admin.name authentication.roles.channel_admin.description 1552912816669 1552912816669 0 manage_channel_roles t t
  612. q5qjsjsn3py5mfodcirqjkhsjy team_user authentication.roles.team_user.name authentication.roles.team_user.description 1552912816680 1552912816680 0 list_team_channels join_public_channels read_public_channel view_team create_public_channel manage_public_channel_properties delete_public_channel create_private_channel manage_private_channel_properties delete_private_channel invite_user add_user_to_team t t
  613. ntqm5c1rbjb9mrh69zagibxoxa team_admin authentication.roles.team_admin.name authentication.roles.team_admin.description 1552912816746 1552912816746 0 edit_others_posts remove_user_from_team manage_team import_team manage_team_roles manage_channel_roles manage_others_webhooks manage_slash_commands manage_others_slash_commands manage_webhooks delete_post delete_others_posts t t
  614. ts6aqp9p6jy97jwyf6wh4f5qaa system_user authentication.roles.global_user.name authentication.roles.global_user.description 1552912816757 1552912816913 0 create_direct_channel create_group_channel permanent_delete_user create_team manage_emojis t t
  615. twatrmjz8i8spfdyus18bm4nth system_admin authentication.roles.global_admin.name authentication.roles.global_admin.description 1552912816481 1552912816923 0 assign_system_admin_role manage_system manage_roles manage_public_channel_properties manage_public_channel_members manage_private_channel_members delete_public_channel create_public_channel manage_private_channel_properties delete_private_channel create_private_channel manage_system_wide_oauth manage_others_webhooks edit_other_users manage_oauth invite_user delete_post delete_others_posts create_team add_user_to_team list_users_without_team manage_jobs create_post_public create_post_ephemeral create_user_access_token read_user_access_token revoke_user_access_token remove_others_reactions list_team_channels join_public_channels read_public_channel view_team read_channel add_reaction remove_reaction upload_file get_public_link create_post use_slash_commands edit_others_posts remove_user_from_team manage_team import_team manage_team_roles manage_channel_roles manage_slash_commands manage_others_slash_commands manage_webhooks edit_post manage_emojis manage_others_emojis t t
  616. \.
  617. --
  618. -- Data for Name: schemes; Type: TABLE DATA; Schema: public; Owner: mmuser
  619. --
  620. COPY public.schemes (id, name, displayname, description, createat, updateat, deleteat, scope, defaultteamadminrole, defaultteamuserrole, defaultchanneladminrole, defaultchanneluserrole) FROM stdin;
  621. \.
  622. --
  623. -- Data for Name: sessions; Type: TABLE DATA; Schema: public; Owner: mmuser
  624. --
  625. COPY public.sessions (id, token, createat, expiresat, lastactivityat, userid, deviceid, roles, isoauth, expirednotify, props) FROM stdin;
  626. \.
  627. --
  628. -- Data for Name: status; Type: TABLE DATA; Schema: public; Owner: mmuser
  629. --
  630. COPY public.status (userid, status, manual, lastactivityat) FROM stdin;
  631. \.
  632. --
  633. -- Data for Name: systems; Type: TABLE DATA; Schema: public; Owner: mmuser
  634. --
  635. COPY public.systems (name, value) FROM stdin;
  636. Version 5.0.0
  637. AsymmetricSigningKey {"ecdsa_key":{"curve":"P-256","x":50494983991025284560870211683226455202411615657166048251398890171377825517363,"y":113694733845764674468191147267904180878076486503487433150108745296643202957034,"d":85042364128488616037616885822024419913274924562562115600648814391088417875310}}
  638. AdvancedPermissionsMigrationComplete true
  639. EmojisPermissionsMigrationComplete true
  640. DiagnosticId up3o75jkjbbs8dbawiwypzwrmc
  641. LastSecurityTime 1552912819442
  642. \.
  643. --
  644. -- Data for Name: teammembers; Type: TABLE DATA; Schema: public; Owner: mmuser
  645. --
  646. COPY public.teammembers (teamid, userid, roles, deleteat, schemeuser, schemeadmin) FROM stdin;
  647. \.
  648. --
  649. -- Data for Name: teams; Type: TABLE DATA; Schema: public; Owner: mmuser
  650. --
  651. COPY public.teams (id, createat, updateat, deleteat, displayname, name, description, email, type, companyname, alloweddomains, inviteid, allowopeninvite, lastteamiconupdate, schemeid) FROM stdin;
  652. \.
  653. --
  654. -- Data for Name: tokens; Type: TABLE DATA; Schema: public; Owner: mmuser
  655. --
  656. COPY public.tokens (token, createat, type, extra) FROM stdin;
  657. \.
  658. --
  659. -- Data for Name: useraccesstokens; Type: TABLE DATA; Schema: public; Owner: mmuser
  660. --
  661. COPY public.useraccesstokens (id, token, userid, description, isactive) FROM stdin;
  662. \.
  663. --
  664. -- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: mmuser
  665. --
  666. COPY public.users (id, createat, updateat, deleteat, username, password, authdata, authservice, email, emailverified, nickname, firstname, lastname, "position", roles, allowmarketing, props, notifyprops, lastpasswordupdate, lastpictureupdate, failedattempts, locale, timezone, mfaactive, mfasecret) FROM stdin;
  667. \.
  668. --
  669. -- Name: audits_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  670. --
  671. ALTER TABLE ONLY public.audits
  672. ADD CONSTRAINT audits_pkey PRIMARY KEY (id);
  673. --
  674. -- Name: channelmemberhistory_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  675. --
  676. ALTER TABLE ONLY public.channelmemberhistory
  677. ADD CONSTRAINT channelmemberhistory_pkey PRIMARY KEY (channelid, userid, jointime);
  678. --
  679. -- Name: channelmembers_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  680. --
  681. ALTER TABLE ONLY public.channelmembers
  682. ADD CONSTRAINT channelmembers_pkey PRIMARY KEY (channelid, userid);
  683. --
  684. -- Name: channels_name_teamid_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  685. --
  686. ALTER TABLE ONLY public.channels
  687. ADD CONSTRAINT channels_name_teamid_key UNIQUE (name, teamid);
  688. --
  689. -- Name: channels_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  690. --
  691. ALTER TABLE ONLY public.channels
  692. ADD CONSTRAINT channels_pkey PRIMARY KEY (id);
  693. --
  694. -- Name: clusterdiscovery_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  695. --
  696. ALTER TABLE ONLY public.clusterdiscovery
  697. ADD CONSTRAINT clusterdiscovery_pkey PRIMARY KEY (id);
  698. --
  699. -- Name: commands_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  700. --
  701. ALTER TABLE ONLY public.commands
  702. ADD CONSTRAINT commands_pkey PRIMARY KEY (id);
  703. --
  704. -- Name: commandwebhooks_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  705. --
  706. ALTER TABLE ONLY public.commandwebhooks
  707. ADD CONSTRAINT commandwebhooks_pkey PRIMARY KEY (id);
  708. --
  709. -- Name: compliances_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  710. --
  711. ALTER TABLE ONLY public.compliances
  712. ADD CONSTRAINT compliances_pkey PRIMARY KEY (id);
  713. --
  714. -- Name: emoji_name_deleteat_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  715. --
  716. ALTER TABLE ONLY public.emoji
  717. ADD CONSTRAINT emoji_name_deleteat_key UNIQUE (name, deleteat);
  718. --
  719. -- Name: emoji_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  720. --
  721. ALTER TABLE ONLY public.emoji
  722. ADD CONSTRAINT emoji_pkey PRIMARY KEY (id);
  723. --
  724. -- Name: fileinfo_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  725. --
  726. ALTER TABLE ONLY public.fileinfo
  727. ADD CONSTRAINT fileinfo_pkey PRIMARY KEY (id);
  728. --
  729. -- Name: incomingwebhooks_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  730. --
  731. ALTER TABLE ONLY public.incomingwebhooks
  732. ADD CONSTRAINT incomingwebhooks_pkey PRIMARY KEY (id);
  733. --
  734. -- Name: jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  735. --
  736. ALTER TABLE ONLY public.jobs
  737. ADD CONSTRAINT jobs_pkey PRIMARY KEY (id);
  738. --
  739. -- Name: licenses_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  740. --
  741. ALTER TABLE ONLY public.licenses
  742. ADD CONSTRAINT licenses_pkey PRIMARY KEY (id);
  743. --
  744. -- Name: oauthaccessdata_clientid_userid_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  745. --
  746. ALTER TABLE ONLY public.oauthaccessdata
  747. ADD CONSTRAINT oauthaccessdata_clientid_userid_key UNIQUE (clientid, userid);
  748. --
  749. -- Name: oauthaccessdata_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  750. --
  751. ALTER TABLE ONLY public.oauthaccessdata
  752. ADD CONSTRAINT oauthaccessdata_pkey PRIMARY KEY (token);
  753. --
  754. -- Name: oauthapps_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  755. --
  756. ALTER TABLE ONLY public.oauthapps
  757. ADD CONSTRAINT oauthapps_pkey PRIMARY KEY (id);
  758. --
  759. -- Name: oauthauthdata_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  760. --
  761. ALTER TABLE ONLY public.oauthauthdata
  762. ADD CONSTRAINT oauthauthdata_pkey PRIMARY KEY (code);
  763. --
  764. -- Name: outgoingwebhooks_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  765. --
  766. ALTER TABLE ONLY public.outgoingwebhooks
  767. ADD CONSTRAINT outgoingwebhooks_pkey PRIMARY KEY (id);
  768. --
  769. -- Name: pluginkeyvaluestore_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  770. --
  771. ALTER TABLE ONLY public.pluginkeyvaluestore
  772. ADD CONSTRAINT pluginkeyvaluestore_pkey PRIMARY KEY (pluginid, pkey);
  773. --
  774. -- Name: posts_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  775. --
  776. ALTER TABLE ONLY public.posts
  777. ADD CONSTRAINT posts_pkey PRIMARY KEY (id);
  778. --
  779. -- Name: preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  780. --
  781. ALTER TABLE ONLY public.preferences
  782. ADD CONSTRAINT preferences_pkey PRIMARY KEY (userid, category, name);
  783. --
  784. -- Name: reactions_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  785. --
  786. ALTER TABLE ONLY public.reactions
  787. ADD CONSTRAINT reactions_pkey PRIMARY KEY (postid, userid, emojiname);
  788. --
  789. -- Name: roles_name_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  790. --
  791. ALTER TABLE ONLY public.roles
  792. ADD CONSTRAINT roles_name_key UNIQUE (name);
  793. --
  794. -- Name: roles_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  795. --
  796. ALTER TABLE ONLY public.roles
  797. ADD CONSTRAINT roles_pkey PRIMARY KEY (id);
  798. --
  799. -- Name: schemes_name_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  800. --
  801. ALTER TABLE ONLY public.schemes
  802. ADD CONSTRAINT schemes_name_key UNIQUE (name);
  803. --
  804. -- Name: schemes_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  805. --
  806. ALTER TABLE ONLY public.schemes
  807. ADD CONSTRAINT schemes_pkey PRIMARY KEY (id);
  808. --
  809. -- Name: sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  810. --
  811. ALTER TABLE ONLY public.sessions
  812. ADD CONSTRAINT sessions_pkey PRIMARY KEY (id);
  813. --
  814. -- Name: status_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  815. --
  816. ALTER TABLE ONLY public.status
  817. ADD CONSTRAINT status_pkey PRIMARY KEY (userid);
  818. --
  819. -- Name: systems_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  820. --
  821. ALTER TABLE ONLY public.systems
  822. ADD CONSTRAINT systems_pkey PRIMARY KEY (name);
  823. --
  824. -- Name: teammembers_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  825. --
  826. ALTER TABLE ONLY public.teammembers
  827. ADD CONSTRAINT teammembers_pkey PRIMARY KEY (teamid, userid);
  828. --
  829. -- Name: teams_name_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  830. --
  831. ALTER TABLE ONLY public.teams
  832. ADD CONSTRAINT teams_name_key UNIQUE (name);
  833. --
  834. -- Name: teams_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  835. --
  836. ALTER TABLE ONLY public.teams
  837. ADD CONSTRAINT teams_pkey PRIMARY KEY (id);
  838. --
  839. -- Name: tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  840. --
  841. ALTER TABLE ONLY public.tokens
  842. ADD CONSTRAINT tokens_pkey PRIMARY KEY (token);
  843. --
  844. -- Name: useraccesstokens_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  845. --
  846. ALTER TABLE ONLY public.useraccesstokens
  847. ADD CONSTRAINT useraccesstokens_pkey PRIMARY KEY (id);
  848. --
  849. -- Name: useraccesstokens_token_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  850. --
  851. ALTER TABLE ONLY public.useraccesstokens
  852. ADD CONSTRAINT useraccesstokens_token_key UNIQUE (token);
  853. --
  854. -- Name: users_authdata_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  855. --
  856. ALTER TABLE ONLY public.users
  857. ADD CONSTRAINT users_authdata_key UNIQUE (authdata);
  858. --
  859. -- Name: users_email_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  860. --
  861. ALTER TABLE ONLY public.users
  862. ADD CONSTRAINT users_email_key UNIQUE (email);
  863. --
  864. -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  865. --
  866. ALTER TABLE ONLY public.users
  867. ADD CONSTRAINT users_pkey PRIMARY KEY (id);
  868. --
  869. -- Name: users_username_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace:
  870. --
  871. ALTER TABLE ONLY public.users
  872. ADD CONSTRAINT users_username_key UNIQUE (username);
  873. --
  874. -- Name: idx_audits_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  875. --
  876. CREATE INDEX idx_audits_user_id ON public.audits USING btree (userid);
  877. --
  878. -- Name: idx_channelmembers_channel_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  879. --
  880. CREATE INDEX idx_channelmembers_channel_id ON public.channelmembers USING btree (channelid);
  881. --
  882. -- Name: idx_channelmembers_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  883. --
  884. CREATE INDEX idx_channelmembers_user_id ON public.channelmembers USING btree (userid);
  885. --
  886. -- Name: idx_channels_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  887. --
  888. CREATE INDEX idx_channels_create_at ON public.channels USING btree (createat);
  889. --
  890. -- Name: idx_channels_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  891. --
  892. CREATE INDEX idx_channels_delete_at ON public.channels USING btree (deleteat);
  893. --
  894. -- Name: idx_channels_displayname_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  895. --
  896. CREATE INDEX idx_channels_displayname_lower ON public.channels USING btree (lower((displayname)::text));
  897. --
  898. -- Name: idx_channels_name; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  899. --
  900. CREATE INDEX idx_channels_name ON public.channels USING btree (name);
  901. --
  902. -- Name: idx_channels_name_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  903. --
  904. CREATE INDEX idx_channels_name_lower ON public.channels USING btree (lower((name)::text));
  905. --
  906. -- Name: idx_channels_team_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  907. --
  908. CREATE INDEX idx_channels_team_id ON public.channels USING btree (teamid);
  909. --
  910. -- Name: idx_channels_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  911. --
  912. CREATE INDEX idx_channels_txt ON public.channels USING gin (to_tsvector('english'::regconfig, (((name)::text || ' '::text) || (displayname)::text)));
  913. --
  914. -- Name: idx_channels_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  915. --
  916. CREATE INDEX idx_channels_update_at ON public.channels USING btree (updateat);
  917. --
  918. -- Name: idx_command_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  919. --
  920. CREATE INDEX idx_command_create_at ON public.commands USING btree (createat);
  921. --
  922. -- Name: idx_command_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  923. --
  924. CREATE INDEX idx_command_delete_at ON public.commands USING btree (deleteat);
  925. --
  926. -- Name: idx_command_team_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  927. --
  928. CREATE INDEX idx_command_team_id ON public.commands USING btree (teamid);
  929. --
  930. -- Name: idx_command_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  931. --
  932. CREATE INDEX idx_command_update_at ON public.commands USING btree (updateat);
  933. --
  934. -- Name: idx_command_webhook_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  935. --
  936. CREATE INDEX idx_command_webhook_create_at ON public.commandwebhooks USING btree (createat);
  937. --
  938. -- Name: idx_emoji_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  939. --
  940. CREATE INDEX idx_emoji_create_at ON public.emoji USING btree (createat);
  941. --
  942. -- Name: idx_emoji_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  943. --
  944. CREATE INDEX idx_emoji_delete_at ON public.emoji USING btree (deleteat);
  945. --
  946. -- Name: idx_emoji_name; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  947. --
  948. CREATE INDEX idx_emoji_name ON public.emoji USING btree (name);
  949. --
  950. -- Name: idx_emoji_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  951. --
  952. CREATE INDEX idx_emoji_update_at ON public.emoji USING btree (updateat);
  953. --
  954. -- Name: idx_fileinfo_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  955. --
  956. CREATE INDEX idx_fileinfo_create_at ON public.fileinfo USING btree (createat);
  957. --
  958. -- Name: idx_fileinfo_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  959. --
  960. CREATE INDEX idx_fileinfo_delete_at ON public.fileinfo USING btree (deleteat);
  961. --
  962. -- Name: idx_fileinfo_postid_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  963. --
  964. CREATE INDEX idx_fileinfo_postid_at ON public.fileinfo USING btree (postid);
  965. --
  966. -- Name: idx_fileinfo_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  967. --
  968. CREATE INDEX idx_fileinfo_update_at ON public.fileinfo USING btree (updateat);
  969. --
  970. -- Name: idx_incoming_webhook_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  971. --
  972. CREATE INDEX idx_incoming_webhook_create_at ON public.incomingwebhooks USING btree (createat);
  973. --
  974. -- Name: idx_incoming_webhook_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  975. --
  976. CREATE INDEX idx_incoming_webhook_delete_at ON public.incomingwebhooks USING btree (deleteat);
  977. --
  978. -- Name: idx_incoming_webhook_team_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  979. --
  980. CREATE INDEX idx_incoming_webhook_team_id ON public.incomingwebhooks USING btree (teamid);
  981. --
  982. -- Name: idx_incoming_webhook_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  983. --
  984. CREATE INDEX idx_incoming_webhook_update_at ON public.incomingwebhooks USING btree (updateat);
  985. --
  986. -- Name: idx_incoming_webhook_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  987. --
  988. CREATE INDEX idx_incoming_webhook_user_id ON public.incomingwebhooks USING btree (userid);
  989. --
  990. -- Name: idx_jobs_type; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  991. --
  992. CREATE INDEX idx_jobs_type ON public.jobs USING btree (type);
  993. --
  994. -- Name: idx_oauthaccessdata_client_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  995. --
  996. CREATE INDEX idx_oauthaccessdata_client_id ON public.oauthaccessdata USING btree (clientid);
  997. --
  998. -- Name: idx_oauthaccessdata_refresh_token; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  999. --
  1000. CREATE INDEX idx_oauthaccessdata_refresh_token ON public.oauthaccessdata USING btree (refreshtoken);
  1001. --
  1002. -- Name: idx_oauthaccessdata_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1003. --
  1004. CREATE INDEX idx_oauthaccessdata_user_id ON public.oauthaccessdata USING btree (userid);
  1005. --
  1006. -- Name: idx_oauthapps_creator_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1007. --
  1008. CREATE INDEX idx_oauthapps_creator_id ON public.oauthapps USING btree (creatorid);
  1009. --
  1010. -- Name: idx_oauthauthdata_client_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1011. --
  1012. CREATE INDEX idx_oauthauthdata_client_id ON public.oauthauthdata USING btree (code);
  1013. --
  1014. -- Name: idx_outgoing_webhook_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1015. --
  1016. CREATE INDEX idx_outgoing_webhook_create_at ON public.outgoingwebhooks USING btree (createat);
  1017. --
  1018. -- Name: idx_outgoing_webhook_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1019. --
  1020. CREATE INDEX idx_outgoing_webhook_delete_at ON public.outgoingwebhooks USING btree (deleteat);
  1021. --
  1022. -- Name: idx_outgoing_webhook_team_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1023. --
  1024. CREATE INDEX idx_outgoing_webhook_team_id ON public.outgoingwebhooks USING btree (teamid);
  1025. --
  1026. -- Name: idx_outgoing_webhook_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1027. --
  1028. CREATE INDEX idx_outgoing_webhook_update_at ON public.outgoingwebhooks USING btree (updateat);
  1029. --
  1030. -- Name: idx_posts_channel_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1031. --
  1032. CREATE INDEX idx_posts_channel_id ON public.posts USING btree (channelid);
  1033. --
  1034. -- Name: idx_posts_channel_id_delete_at_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1035. --
  1036. CREATE INDEX idx_posts_channel_id_delete_at_create_at ON public.posts USING btree (channelid, deleteat, createat);
  1037. --
  1038. -- Name: idx_posts_channel_id_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1039. --
  1040. CREATE INDEX idx_posts_channel_id_update_at ON public.posts USING btree (channelid, updateat);
  1041. --
  1042. -- Name: idx_posts_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1043. --
  1044. CREATE INDEX idx_posts_create_at ON public.posts USING btree (createat);
  1045. --
  1046. -- Name: idx_posts_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1047. --
  1048. CREATE INDEX idx_posts_delete_at ON public.posts USING btree (deleteat);
  1049. --
  1050. -- Name: idx_posts_hashtags_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1051. --
  1052. CREATE INDEX idx_posts_hashtags_txt ON public.posts USING gin (to_tsvector('english'::regconfig, (hashtags)::text));
  1053. --
  1054. -- Name: idx_posts_is_pinned; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1055. --
  1056. CREATE INDEX idx_posts_is_pinned ON public.posts USING btree (ispinned);
  1057. --
  1058. -- Name: idx_posts_message_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1059. --
  1060. CREATE INDEX idx_posts_message_txt ON public.posts USING gin (to_tsvector('english'::regconfig, (message)::text));
  1061. --
  1062. -- Name: idx_posts_root_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1063. --
  1064. CREATE INDEX idx_posts_root_id ON public.posts USING btree (rootid);
  1065. --
  1066. -- Name: idx_posts_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1067. --
  1068. CREATE INDEX idx_posts_update_at ON public.posts USING btree (updateat);
  1069. --
  1070. -- Name: idx_posts_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1071. --
  1072. CREATE INDEX idx_posts_user_id ON public.posts USING btree (userid);
  1073. --
  1074. -- Name: idx_preferences_category; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1075. --
  1076. CREATE INDEX idx_preferences_category ON public.preferences USING btree (category);
  1077. --
  1078. -- Name: idx_preferences_name; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1079. --
  1080. CREATE INDEX idx_preferences_name ON public.preferences USING btree (name);
  1081. --
  1082. -- Name: idx_preferences_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1083. --
  1084. CREATE INDEX idx_preferences_user_id ON public.preferences USING btree (userid);
  1085. --
  1086. -- Name: idx_sessions_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1087. --
  1088. CREATE INDEX idx_sessions_create_at ON public.sessions USING btree (createat);
  1089. --
  1090. -- Name: idx_sessions_expires_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1091. --
  1092. CREATE INDEX idx_sessions_expires_at ON public.sessions USING btree (expiresat);
  1093. --
  1094. -- Name: idx_sessions_last_activity_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1095. --
  1096. CREATE INDEX idx_sessions_last_activity_at ON public.sessions USING btree (lastactivityat);
  1097. --
  1098. -- Name: idx_sessions_token; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1099. --
  1100. CREATE INDEX idx_sessions_token ON public.sessions USING btree (token);
  1101. --
  1102. -- Name: idx_sessions_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1103. --
  1104. CREATE INDEX idx_sessions_user_id ON public.sessions USING btree (userid);
  1105. --
  1106. -- Name: idx_status_status; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1107. --
  1108. CREATE INDEX idx_status_status ON public.status USING btree (status);
  1109. --
  1110. -- Name: idx_status_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1111. --
  1112. CREATE INDEX idx_status_user_id ON public.status USING btree (userid);
  1113. --
  1114. -- Name: idx_teammembers_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1115. --
  1116. CREATE INDEX idx_teammembers_delete_at ON public.teammembers USING btree (deleteat);
  1117. --
  1118. -- Name: idx_teammembers_team_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1119. --
  1120. CREATE INDEX idx_teammembers_team_id ON public.teammembers USING btree (teamid);
  1121. --
  1122. -- Name: idx_teammembers_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1123. --
  1124. CREATE INDEX idx_teammembers_user_id ON public.teammembers USING btree (userid);
  1125. --
  1126. -- Name: idx_teams_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1127. --
  1128. CREATE INDEX idx_teams_create_at ON public.teams USING btree (createat);
  1129. --
  1130. -- Name: idx_teams_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1131. --
  1132. CREATE INDEX idx_teams_delete_at ON public.teams USING btree (deleteat);
  1133. --
  1134. -- Name: idx_teams_invite_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1135. --
  1136. CREATE INDEX idx_teams_invite_id ON public.teams USING btree (inviteid);
  1137. --
  1138. -- Name: idx_teams_name; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1139. --
  1140. CREATE INDEX idx_teams_name ON public.teams USING btree (name);
  1141. --
  1142. -- Name: idx_teams_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1143. --
  1144. CREATE INDEX idx_teams_update_at ON public.teams USING btree (updateat);
  1145. --
  1146. -- Name: idx_user_access_tokens_token; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1147. --
  1148. CREATE INDEX idx_user_access_tokens_token ON public.useraccesstokens USING btree (token);
  1149. --
  1150. -- Name: idx_user_access_tokens_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1151. --
  1152. CREATE INDEX idx_user_access_tokens_user_id ON public.useraccesstokens USING btree (userid);
  1153. --
  1154. -- Name: idx_users_all_no_full_name_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1155. --
  1156. CREATE INDEX idx_users_all_no_full_name_txt ON public.users USING gin (to_tsvector('english'::regconfig, (((((username)::text || ' '::text) || (nickname)::text) || ' '::text) || (email)::text)));
  1157. --
  1158. -- Name: idx_users_all_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1159. --
  1160. CREATE INDEX idx_users_all_txt ON public.users USING gin (to_tsvector('english'::regconfig, (((((((((username)::text || ' '::text) || (firstname)::text) || ' '::text) || (lastname)::text) || ' '::text) || (nickname)::text) || ' '::text) || (email)::text)));
  1161. --
  1162. -- Name: idx_users_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1163. --
  1164. CREATE INDEX idx_users_create_at ON public.users USING btree (createat);
  1165. --
  1166. -- Name: idx_users_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1167. --
  1168. CREATE INDEX idx_users_delete_at ON public.users USING btree (deleteat);
  1169. --
  1170. -- Name: idx_users_email; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1171. --
  1172. CREATE INDEX idx_users_email ON public.users USING btree (email);
  1173. --
  1174. -- Name: idx_users_email_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1175. --
  1176. CREATE INDEX idx_users_email_lower ON public.users USING btree (lower((email)::text));
  1177. --
  1178. -- Name: idx_users_firstname_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1179. --
  1180. CREATE INDEX idx_users_firstname_lower ON public.users USING btree (lower((firstname)::text));
  1181. --
  1182. -- Name: idx_users_lastname_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1183. --
  1184. CREATE INDEX idx_users_lastname_lower ON public.users USING btree (lower((lastname)::text));
  1185. --
  1186. -- Name: idx_users_names_no_full_name_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1187. --
  1188. CREATE INDEX idx_users_names_no_full_name_txt ON public.users USING gin (to_tsvector('english'::regconfig, (((username)::text || ' '::text) || (nickname)::text)));
  1189. --
  1190. -- Name: idx_users_names_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1191. --
  1192. CREATE INDEX idx_users_names_txt ON public.users USING gin (to_tsvector('english'::regconfig, (((((((username)::text || ' '::text) || (firstname)::text) || ' '::text) || (lastname)::text) || ' '::text) || (nickname)::text)));
  1193. --
  1194. -- Name: idx_users_nickname_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1195. --
  1196. CREATE INDEX idx_users_nickname_lower ON public.users USING btree (lower((nickname)::text));
  1197. --
  1198. -- Name: idx_users_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1199. --
  1200. CREATE INDEX idx_users_update_at ON public.users USING btree (updateat);
  1201. --
  1202. -- Name: idx_users_username_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace:
  1203. --
  1204. CREATE INDEX idx_users_username_lower ON public.users USING btree (lower((username)::text));
  1205. --
  1206. -- Name: SCHEMA public; Type: ACL; Schema: -; Owner: mmuser
  1207. --
  1208. REVOKE ALL ON SCHEMA public FROM PUBLIC;
  1209. REVOKE ALL ON SCHEMA public FROM mmuser;
  1210. GRANT ALL ON SCHEMA public TO mmuser;
  1211. GRANT ALL ON SCHEMA public TO PUBLIC;
  1212. --
  1213. -- PostgreSQL database dump complete
  1214. --