1-- 2-- PostgreSQL database dump 3-- 4 5-- Dumped from database version 10.18 (Debian 10.18-1.pgdg90+1) 6-- Dumped by pg_dump version 13.2 7 8SET statement_timeout = 0; 9SET lock_timeout = 0; 10SET idle_in_transaction_session_timeout = 0; 11SET client_encoding = 'UTF8'; 12SET standard_conforming_strings = on; 13SELECT pg_catalog.set_config('search_path', '', false); 14SET check_function_bodies = false; 15SET xmloption = content; 16SET client_min_messages = warning; 17SET row_security = off; 18 19SET default_tablespace = ''; 20 21-- 22-- Name: audits; Type: TABLE; Schema: public; Owner: mmuser 23-- 24 25CREATE TABLE public.audits ( 26 id character varying(26) NOT NULL, 27 createat bigint, 28 userid character varying(26), 29 action character varying(512), 30 extrainfo character varying(1024), 31 ipaddress character varying(64), 32 sessionid character varying(26) 33); 34 35 36ALTER TABLE public.audits OWNER TO mmuser; 37 38-- 39-- Name: bots; Type: TABLE; Schema: public; Owner: mmuser 40-- 41 42CREATE TABLE public.bots ( 43 userid character varying(26) NOT NULL, 44 description character varying(1024), 45 ownerid character varying(190), 46 lasticonupdate bigint, 47 createat bigint, 48 updateat bigint, 49 deleteat bigint 50); 51 52 53ALTER TABLE public.bots OWNER TO mmuser; 54 55-- 56-- Name: channelmemberhistory; Type: TABLE; Schema: public; Owner: mmuser 57-- 58 59CREATE TABLE public.channelmemberhistory ( 60 channelid character varying(26) NOT NULL, 61 userid character varying(26) NOT NULL, 62 jointime bigint NOT NULL, 63 leavetime bigint 64); 65 66 67ALTER TABLE public.channelmemberhistory OWNER TO mmuser; 68 69-- 70-- Name: channelmembers; Type: TABLE; Schema: public; Owner: mmuser 71-- 72 73CREATE TABLE public.channelmembers ( 74 channelid character varying(26) NOT NULL, 75 userid character varying(26) NOT NULL, 76 roles character varying(64), 77 lastviewedat bigint, 78 msgcount bigint, 79 mentioncount bigint, 80 notifyprops jsonb, 81 lastupdateat bigint, 82 schemeuser boolean, 83 schemeadmin boolean, 84 schemeguest boolean, 85 mentioncountroot bigint, 86 msgcountroot bigint 87); 88 89 90ALTER TABLE public.channelmembers OWNER TO mmuser; 91 92-- 93-- Name: channels; Type: TABLE; Schema: public; Owner: mmuser 94-- 95 96CREATE TABLE public.channels ( 97 id character varying(26) NOT NULL, 98 createat bigint, 99 updateat bigint, 100 deleteat bigint, 101 teamid character varying(26), 102 type character varying(1), 103 displayname character varying(64), 104 name character varying(64), 105 header character varying(1024), 106 purpose character varying(250), 107 lastpostat bigint, 108 totalmsgcount bigint, 109 extraupdateat bigint, 110 creatorid character varying(26), 111 schemeid character varying(26), 112 groupconstrained boolean, 113 shared boolean, 114 totalmsgcountroot bigint 115); 116 117 118ALTER TABLE public.channels OWNER TO mmuser; 119 120-- 121-- Name: clusterdiscovery; Type: TABLE; Schema: public; Owner: mmuser 122-- 123 124CREATE TABLE public.clusterdiscovery ( 125 id character varying(26) NOT NULL, 126 type character varying(64), 127 clustername character varying(64), 128 hostname character varying(512), 129 gossipport integer, 130 port integer, 131 createat bigint, 132 lastpingat bigint 133); 134 135 136ALTER TABLE public.clusterdiscovery OWNER TO mmuser; 137 138-- 139-- Name: commands; Type: TABLE; Schema: public; Owner: mmuser 140-- 141 142CREATE TABLE public.commands ( 143 id character varying(26) NOT NULL, 144 token character varying(26), 145 createat bigint, 146 updateat bigint, 147 deleteat bigint, 148 creatorid character varying(26), 149 teamid character varying(26), 150 trigger character varying(128), 151 method character varying(1), 152 username character varying(64), 153 iconurl character varying(1024), 154 autocomplete boolean, 155 autocompletedesc character varying(1024), 156 autocompletehint character varying(1024), 157 displayname character varying(64), 158 description character varying(128), 159 url character varying(1024), 160 pluginid character varying(190) 161); 162 163 164ALTER TABLE public.commands OWNER TO mmuser; 165 166-- 167-- Name: commandwebhooks; Type: TABLE; Schema: public; Owner: mmuser 168-- 169 170CREATE TABLE public.commandwebhooks ( 171 id character varying(26) NOT NULL, 172 createat bigint, 173 commandid character varying(26), 174 userid character varying(26), 175 channelid character varying(26), 176 rootid character varying(26), 177 usecount integer 178); 179 180 181ALTER TABLE public.commandwebhooks OWNER TO mmuser; 182 183-- 184-- Name: compliances; Type: TABLE; Schema: public; Owner: mmuser 185-- 186 187CREATE TABLE public.compliances ( 188 id character varying(26) NOT NULL, 189 createat bigint, 190 userid character varying(26), 191 status character varying(64), 192 count integer, 193 "desc" character varying(512), 194 type character varying(64), 195 startat bigint, 196 endat bigint, 197 keywords character varying(512), 198 emails character varying(1024) 199); 200 201 202ALTER TABLE public.compliances OWNER TO mmuser; 203 204-- 205-- Name: emoji; Type: TABLE; Schema: public; Owner: mmuser 206-- 207 208CREATE TABLE public.emoji ( 209 id character varying(26) NOT NULL, 210 createat bigint, 211 updateat bigint, 212 deleteat bigint, 213 creatorid character varying(26), 214 name character varying(64) 215); 216 217 218ALTER TABLE public.emoji OWNER TO mmuser; 219 220-- 221-- Name: fileinfo; Type: TABLE; Schema: public; Owner: mmuser 222-- 223 224CREATE TABLE public.fileinfo ( 225 id character varying(26) NOT NULL, 226 creatorid character varying(26), 227 postid character varying(26), 228 createat bigint, 229 updateat bigint, 230 deleteat bigint, 231 path character varying(512), 232 thumbnailpath character varying(512), 233 previewpath character varying(512), 234 name character varying(256), 235 extension character varying(64), 236 size bigint, 237 mimetype character varying(256), 238 width integer, 239 height integer, 240 haspreviewimage boolean, 241 minipreview bytea, 242 content text, 243 remoteid character varying(26) 244); 245 246 247ALTER TABLE public.fileinfo OWNER TO mmuser; 248 249-- 250-- Name: groupchannels; Type: TABLE; Schema: public; Owner: mmuser 251-- 252 253CREATE TABLE public.groupchannels ( 254 groupid character varying(26) NOT NULL, 255 autoadd boolean, 256 schemeadmin boolean, 257 createat bigint, 258 deleteat bigint, 259 updateat bigint, 260 channelid character varying(26) NOT NULL 261); 262 263 264ALTER TABLE public.groupchannels OWNER TO mmuser; 265 266-- 267-- Name: groupmembers; Type: TABLE; Schema: public; Owner: mmuser 268-- 269 270CREATE TABLE public.groupmembers ( 271 groupid character varying(26) NOT NULL, 272 userid character varying(26) NOT NULL, 273 createat bigint, 274 deleteat bigint 275); 276 277 278ALTER TABLE public.groupmembers OWNER TO mmuser; 279 280-- 281-- Name: groupteams; Type: TABLE; Schema: public; Owner: mmuser 282-- 283 284CREATE TABLE public.groupteams ( 285 groupid character varying(26) NOT NULL, 286 autoadd boolean, 287 schemeadmin boolean, 288 createat bigint, 289 deleteat bigint, 290 updateat bigint, 291 teamid character varying(26) NOT NULL 292); 293 294 295ALTER TABLE public.groupteams OWNER TO mmuser; 296 297-- 298-- Name: incomingwebhooks; Type: TABLE; Schema: public; Owner: mmuser 299-- 300 301CREATE TABLE public.incomingwebhooks ( 302 id character varying(26) NOT NULL, 303 createat bigint, 304 updateat bigint, 305 deleteat bigint, 306 userid character varying(26), 307 channelid character varying(26), 308 teamid character varying(26), 309 displayname character varying(64), 310 description character varying(500), 311 username character varying(255), 312 iconurl character varying(1024), 313 channellocked boolean 314); 315 316 317ALTER TABLE public.incomingwebhooks OWNER TO mmuser; 318 319-- 320-- Name: jobs; Type: TABLE; Schema: public; Owner: mmuser 321-- 322 323CREATE TABLE public.jobs ( 324 id character varying(26) NOT NULL, 325 type character varying(32), 326 priority bigint, 327 createat bigint, 328 startat bigint, 329 lastactivityat bigint, 330 status character varying(32), 331 progress bigint, 332 data jsonb 333); 334 335 336ALTER TABLE public.jobs OWNER TO mmuser; 337 338-- 339-- Name: licenses; Type: TABLE; Schema: public; Owner: mmuser 340-- 341 342CREATE TABLE public.licenses ( 343 id character varying(26) NOT NULL, 344 createat bigint, 345 bytes character varying(10000) 346); 347 348 349ALTER TABLE public.licenses OWNER TO mmuser; 350 351-- 352-- Name: linkmetadata; Type: TABLE; Schema: public; Owner: mmuser 353-- 354 355CREATE TABLE public.linkmetadata ( 356 hash bigint NOT NULL, 357 url character varying(2048), 358 "timestamp" bigint, 359 type character varying(16), 360 data jsonb 361); 362 363 364ALTER TABLE public.linkmetadata OWNER TO mmuser; 365 366-- 367-- Name: oauthaccessdata; Type: TABLE; Schema: public; Owner: mmuser 368-- 369 370CREATE TABLE public.oauthaccessdata ( 371 clientid character varying(26), 372 userid character varying(26), 373 token character varying(26) NOT NULL, 374 refreshtoken character varying(26), 375 redirecturi character varying(256), 376 expiresat bigint, 377 scope character varying(128) 378); 379 380 381ALTER TABLE public.oauthaccessdata OWNER TO mmuser; 382 383-- 384-- Name: oauthapps; Type: TABLE; Schema: public; Owner: mmuser 385-- 386 387CREATE TABLE public.oauthapps ( 388 id character varying(26) NOT NULL, 389 creatorid character varying(26), 390 createat bigint, 391 updateat bigint, 392 clientsecret character varying(128), 393 name character varying(64), 394 description character varying(512), 395 iconurl character varying(512), 396 callbackurls character varying(1024), 397 homepage character varying(256), 398 istrusted boolean 399); 400 401 402ALTER TABLE public.oauthapps OWNER TO mmuser; 403 404-- 405-- Name: oauthauthdata; Type: TABLE; Schema: public; Owner: mmuser 406-- 407 408CREATE TABLE public.oauthauthdata ( 409 clientid character varying(26), 410 userid character varying(26), 411 code character varying(128) NOT NULL, 412 expiresin integer, 413 createat bigint, 414 redirecturi character varying(256), 415 state character varying(1024), 416 scope character varying(128) 417); 418 419 420ALTER TABLE public.oauthauthdata OWNER TO mmuser; 421 422-- 423-- Name: outgoingwebhooks; Type: TABLE; Schema: public; Owner: mmuser 424-- 425 426CREATE TABLE public.outgoingwebhooks ( 427 id character varying(26) NOT NULL, 428 token character varying(26), 429 createat bigint, 430 updateat bigint, 431 deleteat bigint, 432 creatorid character varying(26), 433 channelid character varying(26), 434 teamid character varying(26), 435 triggerwords character varying(1024), 436 triggerwhen integer, 437 callbackurls character varying(1024), 438 displayname character varying(64), 439 description character varying(500), 440 contenttype character varying(128), 441 username character varying(64), 442 iconurl character varying(1024) 443); 444 445 446ALTER TABLE public.outgoingwebhooks OWNER TO mmuser; 447 448-- 449-- Name: pluginkeyvaluestore; Type: TABLE; Schema: public; Owner: mmuser 450-- 451 452CREATE TABLE public.pluginkeyvaluestore ( 453 pluginid character varying(190) NOT NULL, 454 pkey character varying(50) NOT NULL, 455 pvalue bytea, 456 expireat bigint 457); 458 459 460ALTER TABLE public.pluginkeyvaluestore OWNER TO mmuser; 461 462-- 463-- Name: posts; Type: TABLE; Schema: public; Owner: mmuser 464-- 465 466CREATE TABLE public.posts ( 467 id character varying(26) NOT NULL, 468 createat bigint, 469 updateat bigint, 470 editat bigint, 471 deleteat bigint, 472 ispinned boolean, 473 userid character varying(26), 474 channelid character varying(26), 475 rootid character varying(26), 476 originalid character varying(26), 477 message character varying(65535), 478 type character varying(26), 479 props jsonb, 480 hashtags character varying(1000), 481 filenames character varying(4000), 482 fileids character varying(300), 483 hasreactions boolean, 484 remoteid character varying(26) 485); 486 487 488ALTER TABLE public.posts OWNER TO mmuser; 489 490-- 491-- Name: preferences; Type: TABLE; Schema: public; Owner: mmuser 492-- 493 494CREATE TABLE public.preferences ( 495 userid character varying(26) NOT NULL, 496 category character varying(32) NOT NULL, 497 name character varying(32) NOT NULL, 498 value character varying(2000) 499); 500 501 502ALTER TABLE public.preferences OWNER TO mmuser; 503 504-- 505-- Name: productnoticeviewstate; Type: TABLE; Schema: public; Owner: mmuser 506-- 507 508CREATE TABLE public.productnoticeviewstate ( 509 userid character varying(26) NOT NULL, 510 noticeid character varying(26) NOT NULL, 511 viewed integer, 512 "timestamp" bigint 513); 514 515 516ALTER TABLE public.productnoticeviewstate OWNER TO mmuser; 517 518-- 519-- Name: publicchannels; Type: TABLE; Schema: public; Owner: mmuser 520-- 521 522CREATE TABLE public.publicchannels ( 523 id character varying(26) NOT NULL, 524 deleteat bigint, 525 teamid character varying(26), 526 displayname character varying(64), 527 name character varying(64), 528 header character varying(1024), 529 purpose character varying(250) 530); 531 532 533ALTER TABLE public.publicchannels OWNER TO mmuser; 534 535-- 536-- Name: reactions; Type: TABLE; Schema: public; Owner: mmuser 537-- 538 539CREATE TABLE public.reactions ( 540 userid character varying(26) NOT NULL, 541 postid character varying(26) NOT NULL, 542 emojiname character varying(64) NOT NULL, 543 createat bigint, 544 updateat bigint, 545 deleteat bigint, 546 remoteid character varying(26) 547); 548 549 550ALTER TABLE public.reactions OWNER TO mmuser; 551 552-- 553-- Name: remoteclusters; Type: TABLE; Schema: public; Owner: mmuser 554-- 555 556CREATE TABLE public.remoteclusters ( 557 remoteid character varying(26) NOT NULL, 558 remoteteamid character varying(26), 559 name character varying(64) NOT NULL, 560 displayname character varying(64), 561 siteurl character varying(512), 562 createat bigint, 563 lastpingat bigint, 564 token character varying(26), 565 remotetoken character varying(26), 566 topics character varying(512), 567 creatorid character varying(26) 568); 569 570 571ALTER TABLE public.remoteclusters OWNER TO mmuser; 572 573-- 574-- Name: retentionpolicies; Type: TABLE; Schema: public; Owner: mmuser 575-- 576 577CREATE TABLE public.retentionpolicies ( 578 id character varying(26) NOT NULL, 579 displayname character varying(64), 580 postduration bigint 581); 582 583 584ALTER TABLE public.retentionpolicies OWNER TO mmuser; 585 586-- 587-- Name: retentionpolicieschannels; Type: TABLE; Schema: public; Owner: mmuser 588-- 589 590CREATE TABLE public.retentionpolicieschannels ( 591 policyid character varying(26), 592 channelid character varying(26) NOT NULL 593); 594 595 596ALTER TABLE public.retentionpolicieschannels OWNER TO mmuser; 597 598-- 599-- Name: retentionpoliciesteams; Type: TABLE; Schema: public; Owner: mmuser 600-- 601 602CREATE TABLE public.retentionpoliciesteams ( 603 policyid character varying(26), 604 teamid character varying(26) NOT NULL 605); 606 607 608ALTER TABLE public.retentionpoliciesteams OWNER TO mmuser; 609 610-- 611-- Name: roles; Type: TABLE; Schema: public; Owner: mmuser 612-- 613 614CREATE TABLE public.roles ( 615 id character varying(26) NOT NULL, 616 name character varying(64), 617 displayname character varying(128), 618 description character varying(1024), 619 createat bigint, 620 updateat bigint, 621 deleteat bigint, 622 permissions text, 623 schememanaged boolean, 624 builtin boolean 625); 626 627 628ALTER TABLE public.roles OWNER TO mmuser; 629 630-- 631-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: mmuser 632-- 633 634CREATE TABLE public.schema_migrations ( 635 version bigint NOT NULL, 636 dirty boolean NOT NULL 637); 638 639 640ALTER TABLE public.schema_migrations OWNER TO mmuser; 641 642-- 643-- Name: schemes; Type: TABLE; Schema: public; Owner: mmuser 644-- 645 646CREATE TABLE public.schemes ( 647 id character varying(26) NOT NULL, 648 name character varying(64), 649 displayname character varying(128), 650 description character varying(1024), 651 createat bigint, 652 updateat bigint, 653 deleteat bigint, 654 scope character varying(32), 655 defaultteamadminrole character varying(64), 656 defaultteamuserrole character varying(64), 657 defaultchanneladminrole character varying(64), 658 defaultchanneluserrole character varying(64), 659 defaultteamguestrole character varying(64), 660 defaultchannelguestrole character varying(64) 661); 662 663 664ALTER TABLE public.schemes OWNER TO mmuser; 665 666-- 667-- Name: sessions; Type: TABLE; Schema: public; Owner: mmuser 668-- 669 670CREATE TABLE public.sessions ( 671 id character varying(26) NOT NULL, 672 token character varying(26), 673 createat bigint, 674 expiresat bigint, 675 lastactivityat bigint, 676 userid character varying(26), 677 deviceid character varying(512), 678 roles character varying(64), 679 isoauth boolean, 680 expirednotify boolean, 681 props jsonb 682); 683 684 685ALTER TABLE public.sessions OWNER TO mmuser; 686 687-- 688-- Name: sharedchannelattachments; Type: TABLE; Schema: public; Owner: mmuser 689-- 690 691CREATE TABLE public.sharedchannelattachments ( 692 id character varying(26) NOT NULL, 693 fileid character varying(26), 694 remoteid character varying(26), 695 createat bigint, 696 lastsyncat bigint 697); 698 699 700ALTER TABLE public.sharedchannelattachments OWNER TO mmuser; 701 702-- 703-- Name: sharedchannelremotes; Type: TABLE; Schema: public; Owner: mmuser 704-- 705 706CREATE TABLE public.sharedchannelremotes ( 707 id character varying(26) NOT NULL, 708 channelid character varying(26) NOT NULL, 709 creatorid character varying(26), 710 createat bigint, 711 updateat bigint, 712 isinviteaccepted boolean, 713 isinviteconfirmed boolean, 714 remoteid character varying(26), 715 lastpostupdateat bigint, 716 lastpostid character varying(26) 717); 718 719 720ALTER TABLE public.sharedchannelremotes OWNER TO mmuser; 721 722-- 723-- Name: sharedchannels; Type: TABLE; Schema: public; Owner: mmuser 724-- 725 726CREATE TABLE public.sharedchannels ( 727 channelid character varying(26) NOT NULL, 728 teamid character varying(26), 729 home boolean, 730 readonly boolean, 731 sharename character varying(64), 732 sharedisplayname character varying(64), 733 sharepurpose character varying(250), 734 shareheader character varying(1024), 735 creatorid character varying(26), 736 createat bigint, 737 updateat bigint, 738 remoteid character varying(26) 739); 740 741 742ALTER TABLE public.sharedchannels OWNER TO mmuser; 743 744-- 745-- Name: sharedchannelusers; Type: TABLE; Schema: public; Owner: mmuser 746-- 747 748CREATE TABLE public.sharedchannelusers ( 749 id character varying(26) NOT NULL, 750 userid character varying(26), 751 channelid character varying(26), 752 remoteid character varying(26), 753 createat bigint, 754 lastsyncat bigint 755); 756 757 758ALTER TABLE public.sharedchannelusers OWNER TO mmuser; 759 760-- 761-- Name: sidebarcategories; Type: TABLE; Schema: public; Owner: mmuser 762-- 763 764CREATE TABLE public.sidebarcategories ( 765 id character varying(128) NOT NULL, 766 userid character varying(26), 767 teamid character varying(26), 768 sortorder bigint, 769 sorting character varying(64), 770 type character varying(64), 771 displayname character varying(64), 772 muted boolean, 773 collapsed boolean 774); 775 776 777ALTER TABLE public.sidebarcategories OWNER TO mmuser; 778 779-- 780-- Name: sidebarchannels; Type: TABLE; Schema: public; Owner: mmuser 781-- 782 783CREATE TABLE public.sidebarchannels ( 784 channelid character varying(26) NOT NULL, 785 userid character varying(26) NOT NULL, 786 categoryid character varying(128) NOT NULL, 787 sortorder bigint 788); 789 790 791ALTER TABLE public.sidebarchannels OWNER TO mmuser; 792 793-- 794-- Name: status; Type: TABLE; Schema: public; Owner: mmuser 795-- 796 797CREATE TABLE public.status ( 798 userid character varying(26) NOT NULL, 799 status character varying(32), 800 manual boolean, 801 lastactivityat bigint, 802 dndendtime bigint, 803 prevstatus character varying(32) 804); 805 806 807ALTER TABLE public.status OWNER TO mmuser; 808 809-- 810-- Name: systems; Type: TABLE; Schema: public; Owner: mmuser 811-- 812 813CREATE TABLE public.systems ( 814 name character varying(64) NOT NULL, 815 value character varying(1024) 816); 817 818 819ALTER TABLE public.systems OWNER TO mmuser; 820 821-- 822-- Name: teammembers; Type: TABLE; Schema: public; Owner: mmuser 823-- 824 825CREATE TABLE public.teammembers ( 826 teamid character varying(26) NOT NULL, 827 userid character varying(26) NOT NULL, 828 roles character varying(64), 829 deleteat bigint, 830 schemeuser boolean, 831 schemeadmin boolean, 832 schemeguest boolean 833); 834 835 836ALTER TABLE public.teammembers OWNER TO mmuser; 837 838-- 839-- Name: teams; Type: TABLE; Schema: public; Owner: mmuser 840-- 841 842CREATE TABLE public.teams ( 843 id character varying(26) NOT NULL, 844 createat bigint, 845 updateat bigint, 846 deleteat bigint, 847 displayname character varying(64), 848 name character varying(64), 849 description character varying(255), 850 email character varying(128), 851 type character varying(255), 852 companyname character varying(64), 853 alloweddomains character varying(1000), 854 inviteid character varying(32), 855 schemeid character varying(26), 856 allowopeninvite boolean, 857 lastteamiconupdate bigint, 858 groupconstrained boolean 859); 860 861 862ALTER TABLE public.teams OWNER TO mmuser; 863 864-- 865-- Name: termsofservice; Type: TABLE; Schema: public; Owner: mmuser 866-- 867 868CREATE TABLE public.termsofservice ( 869 id character varying(26) NOT NULL, 870 createat bigint, 871 userid character varying(26), 872 text character varying(65535) 873); 874 875 876ALTER TABLE public.termsofservice OWNER TO mmuser; 877 878-- 879-- Name: threadmemberships; Type: TABLE; Schema: public; Owner: mmuser 880-- 881 882CREATE TABLE public.threadmemberships ( 883 postid character varying(26) NOT NULL, 884 userid character varying(26) NOT NULL, 885 following boolean, 886 lastviewed bigint, 887 lastupdated bigint, 888 unreadmentions bigint 889); 890 891 892ALTER TABLE public.threadmemberships OWNER TO mmuser; 893 894-- 895-- Name: threads; Type: TABLE; Schema: public; Owner: mmuser 896-- 897 898CREATE TABLE public.threads ( 899 postid character varying(26) NOT NULL, 900 channelid character varying(26), 901 replycount bigint, 902 lastreplyat bigint, 903 participants jsonb 904); 905 906 907ALTER TABLE public.threads OWNER TO mmuser; 908 909-- 910-- Name: tokens; Type: TABLE; Schema: public; Owner: mmuser 911-- 912 913CREATE TABLE public.tokens ( 914 token character varying(64) NOT NULL, 915 createat bigint, 916 type character varying(64), 917 extra character varying(2048) 918); 919 920 921ALTER TABLE public.tokens OWNER TO mmuser; 922 923-- 924-- Name: uploadsessions; Type: TABLE; Schema: public; Owner: mmuser 925-- 926 927CREATE TABLE public.uploadsessions ( 928 id character varying(26) NOT NULL, 929 type character varying(32), 930 createat bigint, 931 userid character varying(26), 932 channelid character varying(26), 933 filename character varying(256), 934 path character varying(512), 935 filesize bigint, 936 fileoffset bigint, 937 remoteid character varying(26), 938 reqfileid character varying(26) 939); 940 941 942ALTER TABLE public.uploadsessions OWNER TO mmuser; 943 944-- 945-- Name: useraccesstokens; Type: TABLE; Schema: public; Owner: mmuser 946-- 947 948CREATE TABLE public.useraccesstokens ( 949 id character varying(26) NOT NULL, 950 token character varying(26), 951 userid character varying(26), 952 description character varying(512), 953 isactive boolean 954); 955 956 957ALTER TABLE public.useraccesstokens OWNER TO mmuser; 958 959-- 960-- Name: usergroups; Type: TABLE; Schema: public; Owner: mmuser 961-- 962 963CREATE TABLE public.usergroups ( 964 id character varying(26) NOT NULL, 965 name character varying(64), 966 displayname character varying(128), 967 description character varying(1024), 968 source character varying(64), 969 remoteid character varying(48), 970 createat bigint, 971 updateat bigint, 972 deleteat bigint, 973 allowreference boolean 974); 975 976 977ALTER TABLE public.usergroups OWNER TO mmuser; 978 979-- 980-- Name: users; Type: TABLE; Schema: public; Owner: mmuser 981-- 982 983CREATE TABLE public.users ( 984 id character varying(26) NOT NULL, 985 createat bigint, 986 updateat bigint, 987 deleteat bigint, 988 username character varying(64), 989 password character varying(128), 990 authdata character varying(128), 991 authservice character varying(32), 992 email character varying(128), 993 emailverified boolean, 994 nickname character varying(64), 995 firstname character varying(64), 996 lastname character varying(64), 997 "position" character varying(128), 998 roles character varying(256), 999 allowmarketing boolean, 1000 props jsonb, 1001 notifyprops jsonb, 1002 lastpasswordupdate bigint, 1003 lastpictureupdate bigint, 1004 failedattempts integer, 1005 locale character varying(5), 1006 timezone jsonb, 1007 mfaactive boolean, 1008 mfasecret character varying(128), 1009 remoteid character varying(26) 1010); 1011 1012 1013ALTER TABLE public.users OWNER TO mmuser; 1014 1015-- 1016-- Name: usertermsofservice; Type: TABLE; Schema: public; Owner: mmuser 1017-- 1018 1019CREATE TABLE public.usertermsofservice ( 1020 userid character varying(26) NOT NULL, 1021 termsofserviceid character varying(26), 1022 createat bigint 1023); 1024 1025 1026ALTER TABLE public.usertermsofservice OWNER TO mmuser; 1027 1028-- 1029-- Name: audits audits_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1030-- 1031 1032ALTER TABLE ONLY public.audits 1033 ADD CONSTRAINT audits_pkey PRIMARY KEY (id); 1034 1035 1036-- 1037-- Name: bots bots_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1038-- 1039 1040ALTER TABLE ONLY public.bots 1041 ADD CONSTRAINT bots_pkey PRIMARY KEY (userid); 1042 1043 1044-- 1045-- Name: channelmemberhistory channelmemberhistory_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1046-- 1047 1048ALTER TABLE ONLY public.channelmemberhistory 1049 ADD CONSTRAINT channelmemberhistory_pkey PRIMARY KEY (channelid, userid, jointime); 1050 1051 1052-- 1053-- Name: channelmembers channelmembers_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1054-- 1055 1056ALTER TABLE ONLY public.channelmembers 1057 ADD CONSTRAINT channelmembers_pkey PRIMARY KEY (channelid, userid); 1058 1059 1060-- 1061-- Name: channels channels_name_teamid_key; Type: CONSTRAINT; Schema: public; Owner: mmuser 1062-- 1063 1064ALTER TABLE ONLY public.channels 1065 ADD CONSTRAINT channels_name_teamid_key UNIQUE (name, teamid); 1066 1067 1068-- 1069-- Name: channels channels_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1070-- 1071 1072ALTER TABLE ONLY public.channels 1073 ADD CONSTRAINT channels_pkey PRIMARY KEY (id); 1074 1075 1076-- 1077-- Name: clusterdiscovery clusterdiscovery_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1078-- 1079 1080ALTER TABLE ONLY public.clusterdiscovery 1081 ADD CONSTRAINT clusterdiscovery_pkey PRIMARY KEY (id); 1082 1083 1084-- 1085-- Name: commands commands_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1086-- 1087 1088ALTER TABLE ONLY public.commands 1089 ADD CONSTRAINT commands_pkey PRIMARY KEY (id); 1090 1091 1092-- 1093-- Name: commandwebhooks commandwebhooks_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1094-- 1095 1096ALTER TABLE ONLY public.commandwebhooks 1097 ADD CONSTRAINT commandwebhooks_pkey PRIMARY KEY (id); 1098 1099 1100-- 1101-- Name: compliances compliances_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1102-- 1103 1104ALTER TABLE ONLY public.compliances 1105 ADD CONSTRAINT compliances_pkey PRIMARY KEY (id); 1106 1107 1108-- 1109-- Name: emoji emoji_name_deleteat_key; Type: CONSTRAINT; Schema: public; Owner: mmuser 1110-- 1111 1112ALTER TABLE ONLY public.emoji 1113 ADD CONSTRAINT emoji_name_deleteat_key UNIQUE (name, deleteat); 1114 1115 1116-- 1117-- Name: emoji emoji_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1118-- 1119 1120ALTER TABLE ONLY public.emoji 1121 ADD CONSTRAINT emoji_pkey PRIMARY KEY (id); 1122 1123 1124-- 1125-- Name: fileinfo fileinfo_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1126-- 1127 1128ALTER TABLE ONLY public.fileinfo 1129 ADD CONSTRAINT fileinfo_pkey PRIMARY KEY (id); 1130 1131 1132-- 1133-- Name: groupchannels groupchannels_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1134-- 1135 1136ALTER TABLE ONLY public.groupchannels 1137 ADD CONSTRAINT groupchannels_pkey PRIMARY KEY (groupid, channelid); 1138 1139 1140-- 1141-- Name: groupmembers groupmembers_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1142-- 1143 1144ALTER TABLE ONLY public.groupmembers 1145 ADD CONSTRAINT groupmembers_pkey PRIMARY KEY (groupid, userid); 1146 1147 1148-- 1149-- Name: groupteams groupteams_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1150-- 1151 1152ALTER TABLE ONLY public.groupteams 1153 ADD CONSTRAINT groupteams_pkey PRIMARY KEY (groupid, teamid); 1154 1155 1156-- 1157-- Name: incomingwebhooks incomingwebhooks_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1158-- 1159 1160ALTER TABLE ONLY public.incomingwebhooks 1161 ADD CONSTRAINT incomingwebhooks_pkey PRIMARY KEY (id); 1162 1163 1164-- 1165-- Name: jobs jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1166-- 1167 1168ALTER TABLE ONLY public.jobs 1169 ADD CONSTRAINT jobs_pkey PRIMARY KEY (id); 1170 1171 1172-- 1173-- Name: licenses licenses_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1174-- 1175 1176ALTER TABLE ONLY public.licenses 1177 ADD CONSTRAINT licenses_pkey PRIMARY KEY (id); 1178 1179 1180-- 1181-- Name: linkmetadata linkmetadata_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1182-- 1183 1184ALTER TABLE ONLY public.linkmetadata 1185 ADD CONSTRAINT linkmetadata_pkey PRIMARY KEY (hash); 1186 1187 1188-- 1189-- Name: oauthaccessdata oauthaccessdata_clientid_userid_key; Type: CONSTRAINT; Schema: public; Owner: mmuser 1190-- 1191 1192ALTER TABLE ONLY public.oauthaccessdata 1193 ADD CONSTRAINT oauthaccessdata_clientid_userid_key UNIQUE (clientid, userid); 1194 1195 1196-- 1197-- Name: oauthaccessdata oauthaccessdata_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1198-- 1199 1200ALTER TABLE ONLY public.oauthaccessdata 1201 ADD CONSTRAINT oauthaccessdata_pkey PRIMARY KEY (token); 1202 1203 1204-- 1205-- Name: oauthapps oauthapps_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1206-- 1207 1208ALTER TABLE ONLY public.oauthapps 1209 ADD CONSTRAINT oauthapps_pkey PRIMARY KEY (id); 1210 1211 1212-- 1213-- Name: oauthauthdata oauthauthdata_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1214-- 1215 1216ALTER TABLE ONLY public.oauthauthdata 1217 ADD CONSTRAINT oauthauthdata_pkey PRIMARY KEY (code); 1218 1219 1220-- 1221-- Name: outgoingwebhooks outgoingwebhooks_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1222-- 1223 1224ALTER TABLE ONLY public.outgoingwebhooks 1225 ADD CONSTRAINT outgoingwebhooks_pkey PRIMARY KEY (id); 1226 1227 1228-- 1229-- Name: pluginkeyvaluestore pluginkeyvaluestore_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1230-- 1231 1232ALTER TABLE ONLY public.pluginkeyvaluestore 1233 ADD CONSTRAINT pluginkeyvaluestore_pkey PRIMARY KEY (pluginid, pkey); 1234 1235 1236-- 1237-- Name: posts posts_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1238-- 1239 1240ALTER TABLE ONLY public.posts 1241 ADD CONSTRAINT posts_pkey PRIMARY KEY (id); 1242 1243 1244-- 1245-- Name: preferences preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1246-- 1247 1248ALTER TABLE ONLY public.preferences 1249 ADD CONSTRAINT preferences_pkey PRIMARY KEY (userid, category, name); 1250 1251 1252-- 1253-- Name: productnoticeviewstate productnoticeviewstate_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1254-- 1255 1256ALTER TABLE ONLY public.productnoticeviewstate 1257 ADD CONSTRAINT productnoticeviewstate_pkey PRIMARY KEY (userid, noticeid); 1258 1259 1260-- 1261-- Name: publicchannels publicchannels_name_teamid_key; Type: CONSTRAINT; Schema: public; Owner: mmuser 1262-- 1263 1264ALTER TABLE ONLY public.publicchannels 1265 ADD CONSTRAINT publicchannels_name_teamid_key UNIQUE (name, teamid); 1266 1267 1268-- 1269-- Name: publicchannels publicchannels_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1270-- 1271 1272ALTER TABLE ONLY public.publicchannels 1273 ADD CONSTRAINT publicchannels_pkey PRIMARY KEY (id); 1274 1275 1276-- 1277-- Name: reactions reactions_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1278-- 1279 1280ALTER TABLE ONLY public.reactions 1281 ADD CONSTRAINT reactions_pkey PRIMARY KEY (postid, userid, emojiname); 1282 1283 1284-- 1285-- Name: remoteclusters remoteclusters_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1286-- 1287 1288ALTER TABLE ONLY public.remoteclusters 1289 ADD CONSTRAINT remoteclusters_pkey PRIMARY KEY (remoteid, name); 1290 1291 1292-- 1293-- Name: retentionpolicies retentionpolicies_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1294-- 1295 1296ALTER TABLE ONLY public.retentionpolicies 1297 ADD CONSTRAINT retentionpolicies_pkey PRIMARY KEY (id); 1298 1299 1300-- 1301-- Name: retentionpolicieschannels retentionpolicieschannels_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1302-- 1303 1304ALTER TABLE ONLY public.retentionpolicieschannels 1305 ADD CONSTRAINT retentionpolicieschannels_pkey PRIMARY KEY (channelid); 1306 1307 1308-- 1309-- Name: retentionpoliciesteams retentionpoliciesteams_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1310-- 1311 1312ALTER TABLE ONLY public.retentionpoliciesteams 1313 ADD CONSTRAINT retentionpoliciesteams_pkey PRIMARY KEY (teamid); 1314 1315 1316-- 1317-- Name: roles roles_name_key; Type: CONSTRAINT; Schema: public; Owner: mmuser 1318-- 1319 1320ALTER TABLE ONLY public.roles 1321 ADD CONSTRAINT roles_name_key UNIQUE (name); 1322 1323 1324-- 1325-- Name: roles roles_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1326-- 1327 1328ALTER TABLE ONLY public.roles 1329 ADD CONSTRAINT roles_pkey PRIMARY KEY (id); 1330 1331 1332-- 1333-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1334-- 1335 1336ALTER TABLE ONLY public.schema_migrations 1337 ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); 1338 1339 1340-- 1341-- Name: schemes schemes_name_key; Type: CONSTRAINT; Schema: public; Owner: mmuser 1342-- 1343 1344ALTER TABLE ONLY public.schemes 1345 ADD CONSTRAINT schemes_name_key UNIQUE (name); 1346 1347 1348-- 1349-- Name: schemes schemes_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1350-- 1351 1352ALTER TABLE ONLY public.schemes 1353 ADD CONSTRAINT schemes_pkey PRIMARY KEY (id); 1354 1355 1356-- 1357-- Name: sessions sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1358-- 1359 1360ALTER TABLE ONLY public.sessions 1361 ADD CONSTRAINT sessions_pkey PRIMARY KEY (id); 1362 1363 1364-- 1365-- Name: sharedchannelattachments sharedchannelattachments_fileid_remoteid_key; Type: CONSTRAINT; Schema: public; Owner: mmuser 1366-- 1367 1368ALTER TABLE ONLY public.sharedchannelattachments 1369 ADD CONSTRAINT sharedchannelattachments_fileid_remoteid_key UNIQUE (fileid, remoteid); 1370 1371 1372-- 1373-- Name: sharedchannelattachments sharedchannelattachments_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1374-- 1375 1376ALTER TABLE ONLY public.sharedchannelattachments 1377 ADD CONSTRAINT sharedchannelattachments_pkey PRIMARY KEY (id); 1378 1379 1380-- 1381-- Name: sharedchannelremotes sharedchannelremotes_channelid_remoteid_key; Type: CONSTRAINT; Schema: public; Owner: mmuser 1382-- 1383 1384ALTER TABLE ONLY public.sharedchannelremotes 1385 ADD CONSTRAINT sharedchannelremotes_channelid_remoteid_key UNIQUE (channelid, remoteid); 1386 1387 1388-- 1389-- Name: sharedchannelremotes sharedchannelremotes_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1390-- 1391 1392ALTER TABLE ONLY public.sharedchannelremotes 1393 ADD CONSTRAINT sharedchannelremotes_pkey PRIMARY KEY (id, channelid); 1394 1395 1396-- 1397-- Name: sharedchannels sharedchannels_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1398-- 1399 1400ALTER TABLE ONLY public.sharedchannels 1401 ADD CONSTRAINT sharedchannels_pkey PRIMARY KEY (channelid); 1402 1403 1404-- 1405-- Name: sharedchannels sharedchannels_sharename_teamid_key; Type: CONSTRAINT; Schema: public; Owner: mmuser 1406-- 1407 1408ALTER TABLE ONLY public.sharedchannels 1409 ADD CONSTRAINT sharedchannels_sharename_teamid_key UNIQUE (sharename, teamid); 1410 1411 1412-- 1413-- Name: sharedchannelusers sharedchannelusers_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1414-- 1415 1416ALTER TABLE ONLY public.sharedchannelusers 1417 ADD CONSTRAINT sharedchannelusers_pkey PRIMARY KEY (id); 1418 1419 1420-- 1421-- Name: sharedchannelusers sharedchannelusers_userid_channelid_remoteid_key; Type: CONSTRAINT; Schema: public; Owner: mmuser 1422-- 1423 1424ALTER TABLE ONLY public.sharedchannelusers 1425 ADD CONSTRAINT sharedchannelusers_userid_channelid_remoteid_key UNIQUE (userid, channelid, remoteid); 1426 1427 1428-- 1429-- Name: sidebarcategories sidebarcategories_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1430-- 1431 1432ALTER TABLE ONLY public.sidebarcategories 1433 ADD CONSTRAINT sidebarcategories_pkey PRIMARY KEY (id); 1434 1435 1436-- 1437-- Name: sidebarchannels sidebarchannels_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1438-- 1439 1440ALTER TABLE ONLY public.sidebarchannels 1441 ADD CONSTRAINT sidebarchannels_pkey PRIMARY KEY (channelid, userid, categoryid); 1442 1443 1444-- 1445-- Name: status status_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1446-- 1447 1448ALTER TABLE ONLY public.status 1449 ADD CONSTRAINT status_pkey PRIMARY KEY (userid); 1450 1451 1452-- 1453-- Name: systems systems_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1454-- 1455 1456ALTER TABLE ONLY public.systems 1457 ADD CONSTRAINT systems_pkey PRIMARY KEY (name); 1458 1459 1460-- 1461-- Name: teammembers teammembers_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1462-- 1463 1464ALTER TABLE ONLY public.teammembers 1465 ADD CONSTRAINT teammembers_pkey PRIMARY KEY (teamid, userid); 1466 1467 1468-- 1469-- Name: teams teams_name_key; Type: CONSTRAINT; Schema: public; Owner: mmuser 1470-- 1471 1472ALTER TABLE ONLY public.teams 1473 ADD CONSTRAINT teams_name_key UNIQUE (name); 1474 1475 1476-- 1477-- Name: teams teams_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1478-- 1479 1480ALTER TABLE ONLY public.teams 1481 ADD CONSTRAINT teams_pkey PRIMARY KEY (id); 1482 1483 1484-- 1485-- Name: termsofservice termsofservice_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1486-- 1487 1488ALTER TABLE ONLY public.termsofservice 1489 ADD CONSTRAINT termsofservice_pkey PRIMARY KEY (id); 1490 1491 1492-- 1493-- Name: threadmemberships threadmemberships_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1494-- 1495 1496ALTER TABLE ONLY public.threadmemberships 1497 ADD CONSTRAINT threadmemberships_pkey PRIMARY KEY (postid, userid); 1498 1499 1500-- 1501-- Name: threads threads_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1502-- 1503 1504ALTER TABLE ONLY public.threads 1505 ADD CONSTRAINT threads_pkey PRIMARY KEY (postid); 1506 1507 1508-- 1509-- Name: tokens tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1510-- 1511 1512ALTER TABLE ONLY public.tokens 1513 ADD CONSTRAINT tokens_pkey PRIMARY KEY (token); 1514 1515 1516-- 1517-- Name: uploadsessions uploadsessions_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1518-- 1519 1520ALTER TABLE ONLY public.uploadsessions 1521 ADD CONSTRAINT uploadsessions_pkey PRIMARY KEY (id); 1522 1523 1524-- 1525-- Name: useraccesstokens useraccesstokens_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1526-- 1527 1528ALTER TABLE ONLY public.useraccesstokens 1529 ADD CONSTRAINT useraccesstokens_pkey PRIMARY KEY (id); 1530 1531 1532-- 1533-- Name: useraccesstokens useraccesstokens_token_key; Type: CONSTRAINT; Schema: public; Owner: mmuser 1534-- 1535 1536ALTER TABLE ONLY public.useraccesstokens 1537 ADD CONSTRAINT useraccesstokens_token_key UNIQUE (token); 1538 1539 1540-- 1541-- Name: usergroups usergroups_name_key; Type: CONSTRAINT; Schema: public; Owner: mmuser 1542-- 1543 1544ALTER TABLE ONLY public.usergroups 1545 ADD CONSTRAINT usergroups_name_key UNIQUE (name); 1546 1547 1548-- 1549-- Name: usergroups usergroups_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1550-- 1551 1552ALTER TABLE ONLY public.usergroups 1553 ADD CONSTRAINT usergroups_pkey PRIMARY KEY (id); 1554 1555 1556-- 1557-- Name: usergroups usergroups_source_remoteid_key; Type: CONSTRAINT; Schema: public; Owner: mmuser 1558-- 1559 1560ALTER TABLE ONLY public.usergroups 1561 ADD CONSTRAINT usergroups_source_remoteid_key UNIQUE (source, remoteid); 1562 1563 1564-- 1565-- Name: users users_authdata_key; Type: CONSTRAINT; Schema: public; Owner: mmuser 1566-- 1567 1568ALTER TABLE ONLY public.users 1569 ADD CONSTRAINT users_authdata_key UNIQUE (authdata); 1570 1571 1572-- 1573-- Name: users users_email_key; Type: CONSTRAINT; Schema: public; Owner: mmuser 1574-- 1575 1576ALTER TABLE ONLY public.users 1577 ADD CONSTRAINT users_email_key UNIQUE (email); 1578 1579 1580-- 1581-- Name: users users_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1582-- 1583 1584ALTER TABLE ONLY public.users 1585 ADD CONSTRAINT users_pkey PRIMARY KEY (id); 1586 1587 1588-- 1589-- Name: users users_username_key; Type: CONSTRAINT; Schema: public; Owner: mmuser 1590-- 1591 1592ALTER TABLE ONLY public.users 1593 ADD CONSTRAINT users_username_key UNIQUE (username); 1594 1595 1596-- 1597-- Name: usertermsofservice usertermsofservice_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser 1598-- 1599 1600ALTER TABLE ONLY public.usertermsofservice 1601 ADD CONSTRAINT usertermsofservice_pkey PRIMARY KEY (userid); 1602 1603 1604-- 1605-- Name: idx_audits_user_id; Type: INDEX; Schema: public; Owner: mmuser 1606-- 1607 1608CREATE INDEX idx_audits_user_id ON public.audits USING btree (userid); 1609 1610 1611-- 1612-- Name: idx_channel_search_txt; Type: INDEX; Schema: public; Owner: mmuser 1613-- 1614 1615CREATE INDEX idx_channel_search_txt ON public.channels USING gin (to_tsvector('english'::regconfig, (((((name)::text || ' '::text) || (displayname)::text) || ' '::text) || (purpose)::text))); 1616 1617 1618-- 1619-- Name: idx_channelmembers_channel_id_scheme_guest_user_id; Type: INDEX; Schema: public; Owner: mmuser 1620-- 1621 1622CREATE INDEX idx_channelmembers_channel_id_scheme_guest_user_id ON public.channelmembers USING btree (channelid, schemeguest, userid); 1623 1624 1625-- 1626-- Name: idx_channelmembers_user_id_channel_id_last_viewed_at; Type: INDEX; Schema: public; Owner: mmuser 1627-- 1628 1629CREATE INDEX idx_channelmembers_user_id_channel_id_last_viewed_at ON public.channelmembers USING btree (userid, channelid, lastviewedat); 1630 1631 1632-- 1633-- Name: idx_channels_create_at; Type: INDEX; Schema: public; Owner: mmuser 1634-- 1635 1636CREATE INDEX idx_channels_create_at ON public.channels USING btree (createat); 1637 1638 1639-- 1640-- Name: idx_channels_delete_at; Type: INDEX; Schema: public; Owner: mmuser 1641-- 1642 1643CREATE INDEX idx_channels_delete_at ON public.channels USING btree (deleteat); 1644 1645 1646-- 1647-- Name: idx_channels_displayname_lower; Type: INDEX; Schema: public; Owner: mmuser 1648-- 1649 1650CREATE INDEX idx_channels_displayname_lower ON public.channels USING btree (lower((displayname)::text)); 1651 1652 1653-- 1654-- Name: idx_channels_name_lower; Type: INDEX; Schema: public; Owner: mmuser 1655-- 1656 1657CREATE INDEX idx_channels_name_lower ON public.channels USING btree (lower((name)::text)); 1658 1659 1660-- 1661-- Name: idx_channels_scheme_id; Type: INDEX; Schema: public; Owner: mmuser 1662-- 1663 1664CREATE INDEX idx_channels_scheme_id ON public.channels USING btree (schemeid); 1665 1666 1667-- 1668-- Name: idx_channels_team_id_display_name; Type: INDEX; Schema: public; Owner: mmuser 1669-- 1670 1671CREATE INDEX idx_channels_team_id_display_name ON public.channels USING btree (teamid, displayname); 1672 1673 1674-- 1675-- Name: idx_channels_team_id_type; Type: INDEX; Schema: public; Owner: mmuser 1676-- 1677 1678CREATE INDEX idx_channels_team_id_type ON public.channels USING btree (teamid, type); 1679 1680 1681-- 1682-- Name: idx_channels_update_at; Type: INDEX; Schema: public; Owner: mmuser 1683-- 1684 1685CREATE INDEX idx_channels_update_at ON public.channels USING btree (updateat); 1686 1687 1688-- 1689-- Name: idx_command_create_at; Type: INDEX; Schema: public; Owner: mmuser 1690-- 1691 1692CREATE INDEX idx_command_create_at ON public.commands USING btree (createat); 1693 1694 1695-- 1696-- Name: idx_command_delete_at; Type: INDEX; Schema: public; Owner: mmuser 1697-- 1698 1699CREATE INDEX idx_command_delete_at ON public.commands USING btree (deleteat); 1700 1701 1702-- 1703-- Name: idx_command_team_id; Type: INDEX; Schema: public; Owner: mmuser 1704-- 1705 1706CREATE INDEX idx_command_team_id ON public.commands USING btree (teamid); 1707 1708 1709-- 1710-- Name: idx_command_update_at; Type: INDEX; Schema: public; Owner: mmuser 1711-- 1712 1713CREATE INDEX idx_command_update_at ON public.commands USING btree (updateat); 1714 1715 1716-- 1717-- Name: idx_command_webhook_create_at; Type: INDEX; Schema: public; Owner: mmuser 1718-- 1719 1720CREATE INDEX idx_command_webhook_create_at ON public.commandwebhooks USING btree (createat); 1721 1722 1723-- 1724-- Name: idx_emoji_create_at; Type: INDEX; Schema: public; Owner: mmuser 1725-- 1726 1727CREATE INDEX idx_emoji_create_at ON public.emoji USING btree (createat); 1728 1729 1730-- 1731-- Name: idx_emoji_delete_at; Type: INDEX; Schema: public; Owner: mmuser 1732-- 1733 1734CREATE INDEX idx_emoji_delete_at ON public.emoji USING btree (deleteat); 1735 1736 1737-- 1738-- Name: idx_emoji_update_at; Type: INDEX; Schema: public; Owner: mmuser 1739-- 1740 1741CREATE INDEX idx_emoji_update_at ON public.emoji USING btree (updateat); 1742 1743 1744-- 1745-- Name: idx_fileinfo_content_txt; Type: INDEX; Schema: public; Owner: mmuser 1746-- 1747 1748CREATE INDEX idx_fileinfo_content_txt ON public.fileinfo USING gin (to_tsvector('english'::regconfig, content)); 1749 1750 1751-- 1752-- Name: idx_fileinfo_create_at; Type: INDEX; Schema: public; Owner: mmuser 1753-- 1754 1755CREATE INDEX idx_fileinfo_create_at ON public.fileinfo USING btree (createat); 1756 1757 1758-- 1759-- Name: idx_fileinfo_delete_at; Type: INDEX; Schema: public; Owner: mmuser 1760-- 1761 1762CREATE INDEX idx_fileinfo_delete_at ON public.fileinfo USING btree (deleteat); 1763 1764 1765-- 1766-- Name: idx_fileinfo_extension_at; Type: INDEX; Schema: public; Owner: mmuser 1767-- 1768 1769CREATE INDEX idx_fileinfo_extension_at ON public.fileinfo USING btree (extension); 1770 1771 1772-- 1773-- Name: idx_fileinfo_name_splitted; Type: INDEX; Schema: public; Owner: mmuser 1774-- 1775 1776CREATE INDEX idx_fileinfo_name_splitted ON public.fileinfo USING gin (to_tsvector('english'::regconfig, translate((name)::text, '.,-'::text, ' '::text))); 1777 1778 1779-- 1780-- Name: idx_fileinfo_name_txt; Type: INDEX; Schema: public; Owner: mmuser 1781-- 1782 1783CREATE INDEX idx_fileinfo_name_txt ON public.fileinfo USING gin (to_tsvector('english'::regconfig, (name)::text)); 1784 1785 1786-- 1787-- Name: idx_fileinfo_postid_at; Type: INDEX; Schema: public; Owner: mmuser 1788-- 1789 1790CREATE INDEX idx_fileinfo_postid_at ON public.fileinfo USING btree (postid); 1791 1792 1793-- 1794-- Name: idx_fileinfo_update_at; Type: INDEX; Schema: public; Owner: mmuser 1795-- 1796 1797CREATE INDEX idx_fileinfo_update_at ON public.fileinfo USING btree (updateat); 1798 1799 1800-- 1801-- Name: idx_groupchannels_channelid; Type: INDEX; Schema: public; Owner: mmuser 1802-- 1803 1804CREATE INDEX idx_groupchannels_channelid ON public.groupchannels USING btree (channelid); 1805 1806 1807-- 1808-- Name: idx_groupchannels_schemeadmin; Type: INDEX; Schema: public; Owner: mmuser 1809-- 1810 1811CREATE INDEX idx_groupchannels_schemeadmin ON public.groupchannels USING btree (schemeadmin); 1812 1813 1814-- 1815-- Name: idx_groupmembers_create_at; Type: INDEX; Schema: public; Owner: mmuser 1816-- 1817 1818CREATE INDEX idx_groupmembers_create_at ON public.groupmembers USING btree (createat); 1819 1820 1821-- 1822-- Name: idx_groupteams_schemeadmin; Type: INDEX; Schema: public; Owner: mmuser 1823-- 1824 1825CREATE INDEX idx_groupteams_schemeadmin ON public.groupteams USING btree (schemeadmin); 1826 1827 1828-- 1829-- Name: idx_groupteams_teamid; Type: INDEX; Schema: public; Owner: mmuser 1830-- 1831 1832CREATE INDEX idx_groupteams_teamid ON public.groupteams USING btree (teamid); 1833 1834 1835-- 1836-- Name: idx_incoming_webhook_create_at; Type: INDEX; Schema: public; Owner: mmuser 1837-- 1838 1839CREATE INDEX idx_incoming_webhook_create_at ON public.incomingwebhooks USING btree (createat); 1840 1841 1842-- 1843-- Name: idx_incoming_webhook_delete_at; Type: INDEX; Schema: public; Owner: mmuser 1844-- 1845 1846CREATE INDEX idx_incoming_webhook_delete_at ON public.incomingwebhooks USING btree (deleteat); 1847 1848 1849-- 1850-- Name: idx_incoming_webhook_team_id; Type: INDEX; Schema: public; Owner: mmuser 1851-- 1852 1853CREATE INDEX idx_incoming_webhook_team_id ON public.incomingwebhooks USING btree (teamid); 1854 1855 1856-- 1857-- Name: idx_incoming_webhook_update_at; Type: INDEX; Schema: public; Owner: mmuser 1858-- 1859 1860CREATE INDEX idx_incoming_webhook_update_at ON public.incomingwebhooks USING btree (updateat); 1861 1862 1863-- 1864-- Name: idx_incoming_webhook_user_id; Type: INDEX; Schema: public; Owner: mmuser 1865-- 1866 1867CREATE INDEX idx_incoming_webhook_user_id ON public.incomingwebhooks USING btree (userid); 1868 1869 1870-- 1871-- Name: idx_jobs_type; Type: INDEX; Schema: public; Owner: mmuser 1872-- 1873 1874CREATE INDEX idx_jobs_type ON public.jobs USING btree (type); 1875 1876 1877-- 1878-- Name: idx_link_metadata_url_timestamp; Type: INDEX; Schema: public; Owner: mmuser 1879-- 1880 1881CREATE INDEX idx_link_metadata_url_timestamp ON public.linkmetadata USING btree (url, "timestamp"); 1882 1883 1884-- 1885-- Name: idx_notice_views_notice_id; Type: INDEX; Schema: public; Owner: mmuser 1886-- 1887 1888CREATE INDEX idx_notice_views_notice_id ON public.productnoticeviewstate USING btree (noticeid); 1889 1890 1891-- 1892-- Name: idx_notice_views_timestamp; Type: INDEX; Schema: public; Owner: mmuser 1893-- 1894 1895CREATE INDEX idx_notice_views_timestamp ON public.productnoticeviewstate USING btree ("timestamp"); 1896 1897 1898-- 1899-- Name: idx_oauthaccessdata_refresh_token; Type: INDEX; Schema: public; Owner: mmuser 1900-- 1901 1902CREATE INDEX idx_oauthaccessdata_refresh_token ON public.oauthaccessdata USING btree (refreshtoken); 1903 1904 1905-- 1906-- Name: idx_oauthaccessdata_user_id; Type: INDEX; Schema: public; Owner: mmuser 1907-- 1908 1909CREATE INDEX idx_oauthaccessdata_user_id ON public.oauthaccessdata USING btree (userid); 1910 1911 1912-- 1913-- Name: idx_oauthapps_creator_id; Type: INDEX; Schema: public; Owner: mmuser 1914-- 1915 1916CREATE INDEX idx_oauthapps_creator_id ON public.oauthapps USING btree (creatorid); 1917 1918 1919-- 1920-- Name: idx_outgoing_webhook_create_at; Type: INDEX; Schema: public; Owner: mmuser 1921-- 1922 1923CREATE INDEX idx_outgoing_webhook_create_at ON public.outgoingwebhooks USING btree (createat); 1924 1925 1926-- 1927-- Name: idx_outgoing_webhook_delete_at; Type: INDEX; Schema: public; Owner: mmuser 1928-- 1929 1930CREATE INDEX idx_outgoing_webhook_delete_at ON public.outgoingwebhooks USING btree (deleteat); 1931 1932 1933-- 1934-- Name: idx_outgoing_webhook_team_id; Type: INDEX; Schema: public; Owner: mmuser 1935-- 1936 1937CREATE INDEX idx_outgoing_webhook_team_id ON public.outgoingwebhooks USING btree (teamid); 1938 1939 1940-- 1941-- Name: idx_outgoing_webhook_update_at; Type: INDEX; Schema: public; Owner: mmuser 1942-- 1943 1944CREATE INDEX idx_outgoing_webhook_update_at ON public.outgoingwebhooks USING btree (updateat); 1945 1946 1947-- 1948-- Name: idx_posts_channel_id_delete_at_create_at; Type: INDEX; Schema: public; Owner: mmuser 1949-- 1950 1951CREATE INDEX idx_posts_channel_id_delete_at_create_at ON public.posts USING btree (channelid, deleteat, createat); 1952 1953 1954-- 1955-- Name: idx_posts_channel_id_update_at; Type: INDEX; Schema: public; Owner: mmuser 1956-- 1957 1958CREATE INDEX idx_posts_channel_id_update_at ON public.posts USING btree (channelid, updateat); 1959 1960 1961-- 1962-- Name: idx_posts_create_at; Type: INDEX; Schema: public; Owner: mmuser 1963-- 1964 1965CREATE INDEX idx_posts_create_at ON public.posts USING btree (createat); 1966 1967 1968-- 1969-- Name: idx_posts_delete_at; Type: INDEX; Schema: public; Owner: mmuser 1970-- 1971 1972CREATE INDEX idx_posts_delete_at ON public.posts USING btree (deleteat); 1973 1974 1975-- 1976-- Name: idx_posts_hashtags_txt; Type: INDEX; Schema: public; Owner: mmuser 1977-- 1978 1979CREATE INDEX idx_posts_hashtags_txt ON public.posts USING gin (to_tsvector('english'::regconfig, (hashtags)::text)); 1980 1981 1982-- 1983-- Name: idx_posts_is_pinned; Type: INDEX; Schema: public; Owner: mmuser 1984-- 1985 1986CREATE INDEX idx_posts_is_pinned ON public.posts USING btree (ispinned); 1987 1988 1989-- 1990-- Name: idx_posts_message_txt; Type: INDEX; Schema: public; Owner: mmuser 1991-- 1992 1993CREATE INDEX idx_posts_message_txt ON public.posts USING gin (to_tsvector('english'::regconfig, (message)::text)); 1994 1995 1996-- 1997-- Name: idx_posts_root_id_delete_at; Type: INDEX; Schema: public; Owner: mmuser 1998-- 1999 2000CREATE INDEX idx_posts_root_id_delete_at ON public.posts USING btree (rootid, deleteat); 2001 2002 2003-- 2004-- Name: idx_posts_update_at; Type: INDEX; Schema: public; Owner: mmuser 2005-- 2006 2007CREATE INDEX idx_posts_update_at ON public.posts USING btree (updateat); 2008 2009 2010-- 2011-- Name: idx_posts_user_id; Type: INDEX; Schema: public; Owner: mmuser 2012-- 2013 2014CREATE INDEX idx_posts_user_id ON public.posts USING btree (userid); 2015 2016 2017-- 2018-- Name: idx_preferences_category; Type: INDEX; Schema: public; Owner: mmuser 2019-- 2020 2021CREATE INDEX idx_preferences_category ON public.preferences USING btree (category); 2022 2023 2024-- 2025-- Name: idx_preferences_name; Type: INDEX; Schema: public; Owner: mmuser 2026-- 2027 2028CREATE INDEX idx_preferences_name ON public.preferences USING btree (name); 2029 2030 2031-- 2032-- Name: idx_publicchannels_delete_at; Type: INDEX; Schema: public; Owner: mmuser 2033-- 2034 2035CREATE INDEX idx_publicchannels_delete_at ON public.publicchannels USING btree (deleteat); 2036 2037 2038-- 2039-- Name: idx_publicchannels_displayname_lower; Type: INDEX; Schema: public; Owner: mmuser 2040-- 2041 2042CREATE INDEX idx_publicchannels_displayname_lower ON public.publicchannels USING btree (lower((displayname)::text)); 2043 2044 2045-- 2046-- Name: idx_publicchannels_name_lower; Type: INDEX; Schema: public; Owner: mmuser 2047-- 2048 2049CREATE INDEX idx_publicchannels_name_lower ON public.publicchannels USING btree (lower((name)::text)); 2050 2051 2052-- 2053-- Name: idx_publicchannels_search_txt; Type: INDEX; Schema: public; Owner: mmuser 2054-- 2055 2056CREATE INDEX idx_publicchannels_search_txt ON public.publicchannels USING gin (to_tsvector('english'::regconfig, (((((name)::text || ' '::text) || (displayname)::text) || ' '::text) || (purpose)::text))); 2057 2058 2059-- 2060-- Name: idx_publicchannels_team_id; Type: INDEX; Schema: public; Owner: mmuser 2061-- 2062 2063CREATE INDEX idx_publicchannels_team_id ON public.publicchannels USING btree (teamid); 2064 2065 2066-- 2067-- Name: idx_retentionpolicies_displayname; Type: INDEX; Schema: public; Owner: mmuser 2068-- 2069 2070CREATE INDEX idx_retentionpolicies_displayname ON public.retentionpolicies USING btree (displayname); 2071 2072 2073-- 2074-- Name: idx_retentionpolicieschannels_policyid; Type: INDEX; Schema: public; Owner: mmuser 2075-- 2076 2077CREATE INDEX idx_retentionpolicieschannels_policyid ON public.retentionpolicieschannels USING btree (policyid); 2078 2079 2080-- 2081-- Name: idx_retentionpoliciesteams_policyid; Type: INDEX; Schema: public; Owner: mmuser 2082-- 2083 2084CREATE INDEX idx_retentionpoliciesteams_policyid ON public.retentionpoliciesteams USING btree (policyid); 2085 2086 2087-- 2088-- Name: idx_schemes_channel_admin_role; Type: INDEX; Schema: public; Owner: mmuser 2089-- 2090 2091CREATE INDEX idx_schemes_channel_admin_role ON public.schemes USING btree (defaultchanneladminrole); 2092 2093 2094-- 2095-- Name: idx_schemes_channel_guest_role; Type: INDEX; Schema: public; Owner: mmuser 2096-- 2097 2098CREATE INDEX idx_schemes_channel_guest_role ON public.schemes USING btree (defaultchannelguestrole); 2099 2100 2101-- 2102-- Name: idx_schemes_channel_user_role; Type: INDEX; Schema: public; Owner: mmuser 2103-- 2104 2105CREATE INDEX idx_schemes_channel_user_role ON public.schemes USING btree (defaultchanneluserrole); 2106 2107 2108-- 2109-- Name: idx_sessions_create_at; Type: INDEX; Schema: public; Owner: mmuser 2110-- 2111 2112CREATE INDEX idx_sessions_create_at ON public.sessions USING btree (createat); 2113 2114 2115-- 2116-- Name: idx_sessions_expires_at; Type: INDEX; Schema: public; Owner: mmuser 2117-- 2118 2119CREATE INDEX idx_sessions_expires_at ON public.sessions USING btree (expiresat); 2120 2121 2122-- 2123-- Name: idx_sessions_last_activity_at; Type: INDEX; Schema: public; Owner: mmuser 2124-- 2125 2126CREATE INDEX idx_sessions_last_activity_at ON public.sessions USING btree (lastactivityat); 2127 2128 2129-- 2130-- Name: idx_sessions_token; Type: INDEX; Schema: public; Owner: mmuser 2131-- 2132 2133CREATE INDEX idx_sessions_token ON public.sessions USING btree (token); 2134 2135 2136-- 2137-- Name: idx_sessions_user_id; Type: INDEX; Schema: public; Owner: mmuser 2138-- 2139 2140CREATE INDEX idx_sessions_user_id ON public.sessions USING btree (userid); 2141 2142 2143-- 2144-- Name: idx_sharedchannelusers_remote_id; Type: INDEX; Schema: public; Owner: mmuser 2145-- 2146 2147CREATE INDEX idx_sharedchannelusers_remote_id ON public.sharedchannelusers USING btree (remoteid); 2148 2149 2150-- 2151-- Name: idx_status_status_dndendtime; Type: INDEX; Schema: public; Owner: mmuser 2152-- 2153 2154CREATE INDEX idx_status_status_dndendtime ON public.status USING btree (status, dndendtime); 2155 2156 2157-- 2158-- Name: idx_teammembers_delete_at; Type: INDEX; Schema: public; Owner: mmuser 2159-- 2160 2161CREATE INDEX idx_teammembers_delete_at ON public.teammembers USING btree (deleteat); 2162 2163 2164-- 2165-- Name: idx_teammembers_user_id; Type: INDEX; Schema: public; Owner: mmuser 2166-- 2167 2168CREATE INDEX idx_teammembers_user_id ON public.teammembers USING btree (userid); 2169 2170 2171-- 2172-- Name: idx_teams_create_at; Type: INDEX; Schema: public; Owner: mmuser 2173-- 2174 2175CREATE INDEX idx_teams_create_at ON public.teams USING btree (createat); 2176 2177 2178-- 2179-- Name: idx_teams_delete_at; Type: INDEX; Schema: public; Owner: mmuser 2180-- 2181 2182CREATE INDEX idx_teams_delete_at ON public.teams USING btree (deleteat); 2183 2184 2185-- 2186-- Name: idx_teams_invite_id; Type: INDEX; Schema: public; Owner: mmuser 2187-- 2188 2189CREATE INDEX idx_teams_invite_id ON public.teams USING btree (inviteid); 2190 2191 2192-- 2193-- Name: idx_teams_scheme_id; Type: INDEX; Schema: public; Owner: mmuser 2194-- 2195 2196CREATE INDEX idx_teams_scheme_id ON public.teams USING btree (schemeid); 2197 2198 2199-- 2200-- Name: idx_teams_update_at; Type: INDEX; Schema: public; Owner: mmuser 2201-- 2202 2203CREATE INDEX idx_teams_update_at ON public.teams USING btree (updateat); 2204 2205 2206-- 2207-- Name: idx_thread_memberships_last_update_at; Type: INDEX; Schema: public; Owner: mmuser 2208-- 2209 2210CREATE INDEX idx_thread_memberships_last_update_at ON public.threadmemberships USING btree (lastupdated); 2211 2212 2213-- 2214-- Name: idx_thread_memberships_last_view_at; Type: INDEX; Schema: public; Owner: mmuser 2215-- 2216 2217CREATE INDEX idx_thread_memberships_last_view_at ON public.threadmemberships USING btree (lastviewed); 2218 2219 2220-- 2221-- Name: idx_thread_memberships_user_id; Type: INDEX; Schema: public; Owner: mmuser 2222-- 2223 2224CREATE INDEX idx_thread_memberships_user_id ON public.threadmemberships USING btree (userid); 2225 2226 2227-- 2228-- Name: idx_threads_channel_id_last_reply_at; Type: INDEX; Schema: public; Owner: mmuser 2229-- 2230 2231CREATE INDEX idx_threads_channel_id_last_reply_at ON public.threads USING btree (channelid, lastreplyat); 2232 2233 2234-- 2235-- Name: idx_uploadsessions_create_at; Type: INDEX; Schema: public; Owner: mmuser 2236-- 2237 2238CREATE INDEX idx_uploadsessions_create_at ON public.uploadsessions USING btree (createat); 2239 2240 2241-- 2242-- Name: idx_uploadsessions_user_id; Type: INDEX; Schema: public; Owner: mmuser 2243-- 2244 2245CREATE INDEX idx_uploadsessions_user_id ON public.uploadsessions USING btree (type); 2246 2247 2248-- 2249-- Name: idx_user_access_tokens_user_id; Type: INDEX; Schema: public; Owner: mmuser 2250-- 2251 2252CREATE INDEX idx_user_access_tokens_user_id ON public.useraccesstokens USING btree (userid); 2253 2254 2255-- 2256-- Name: idx_usergroups_delete_at; Type: INDEX; Schema: public; Owner: mmuser 2257-- 2258 2259CREATE INDEX idx_usergroups_delete_at ON public.usergroups USING btree (deleteat); 2260 2261 2262-- 2263-- Name: idx_usergroups_remote_id; Type: INDEX; Schema: public; Owner: mmuser 2264-- 2265 2266CREATE INDEX idx_usergroups_remote_id ON public.usergroups USING btree (remoteid); 2267 2268 2269-- 2270-- Name: idx_users_all_no_full_name_txt; Type: INDEX; Schema: public; Owner: mmuser 2271-- 2272 2273CREATE 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))); 2274 2275 2276-- 2277-- Name: idx_users_all_txt; Type: INDEX; Schema: public; Owner: mmuser 2278-- 2279 2280CREATE 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))); 2281 2282 2283-- 2284-- Name: idx_users_create_at; Type: INDEX; Schema: public; Owner: mmuser 2285-- 2286 2287CREATE INDEX idx_users_create_at ON public.users USING btree (createat); 2288 2289 2290-- 2291-- Name: idx_users_delete_at; Type: INDEX; Schema: public; Owner: mmuser 2292-- 2293 2294CREATE INDEX idx_users_delete_at ON public.users USING btree (deleteat); 2295 2296 2297-- 2298-- Name: idx_users_email_lower_textpattern; Type: INDEX; Schema: public; Owner: mmuser 2299-- 2300 2301CREATE INDEX idx_users_email_lower_textpattern ON public.users USING btree (lower((email)::text) text_pattern_ops); 2302 2303 2304-- 2305-- Name: idx_users_firstname_lower_textpattern; Type: INDEX; Schema: public; Owner: mmuser 2306-- 2307 2308CREATE INDEX idx_users_firstname_lower_textpattern ON public.users USING btree (lower((firstname)::text) text_pattern_ops); 2309 2310 2311-- 2312-- Name: idx_users_lastname_lower_textpattern; Type: INDEX; Schema: public; Owner: mmuser 2313-- 2314 2315CREATE INDEX idx_users_lastname_lower_textpattern ON public.users USING btree (lower((lastname)::text) text_pattern_ops); 2316 2317 2318-- 2319-- Name: idx_users_names_no_full_name_txt; Type: INDEX; Schema: public; Owner: mmuser 2320-- 2321 2322CREATE INDEX idx_users_names_no_full_name_txt ON public.users USING gin (to_tsvector('english'::regconfig, (((username)::text || ' '::text) || (nickname)::text))); 2323 2324 2325-- 2326-- Name: idx_users_names_txt; Type: INDEX; Schema: public; Owner: mmuser 2327-- 2328 2329CREATE 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))); 2330 2331 2332-- 2333-- Name: idx_users_nickname_lower_textpattern; Type: INDEX; Schema: public; Owner: mmuser 2334-- 2335 2336CREATE INDEX idx_users_nickname_lower_textpattern ON public.users USING btree (lower((nickname)::text) text_pattern_ops); 2337 2338 2339-- 2340-- Name: idx_users_update_at; Type: INDEX; Schema: public; Owner: mmuser 2341-- 2342 2343CREATE INDEX idx_users_update_at ON public.users USING btree (updateat); 2344 2345 2346-- 2347-- Name: idx_users_username_lower_textpattern; Type: INDEX; Schema: public; Owner: mmuser 2348-- 2349 2350CREATE INDEX idx_users_username_lower_textpattern ON public.users USING btree (lower((username)::text) text_pattern_ops); 2351 2352 2353-- 2354-- Name: remote_clusters_site_url_unique; Type: INDEX; Schema: public; Owner: mmuser 2355-- 2356 2357CREATE UNIQUE INDEX remote_clusters_site_url_unique ON public.remoteclusters USING btree (siteurl, remoteteamid); 2358 2359 2360-- 2361-- Name: retentionpolicieschannels fk_retentionpolicieschannels_retentionpolicies; Type: FK CONSTRAINT; Schema: public; Owner: mmuser 2362-- 2363 2364ALTER TABLE ONLY public.retentionpolicieschannels 2365 ADD CONSTRAINT fk_retentionpolicieschannels_retentionpolicies FOREIGN KEY (policyid) REFERENCES public.retentionpolicies(id) ON DELETE CASCADE; 2366 2367 2368-- 2369-- Name: retentionpoliciesteams fk_retentionpoliciesteams_retentionpolicies; Type: FK CONSTRAINT; Schema: public; Owner: mmuser 2370-- 2371 2372ALTER TABLE ONLY public.retentionpoliciesteams 2373 ADD CONSTRAINT fk_retentionpoliciesteams_retentionpolicies FOREIGN KEY (policyid) REFERENCES public.retentionpolicies(id) ON DELETE CASCADE; 2374 2375 2376-- 2377-- PostgreSQL database dump complete 2378-- 2379 2380