github.com/haalcala/mattermost-server-change-repo@v0.0.0-20210713015153-16753fbeee5f/scripts/mattermost-postgresql-5.0.sql (about)

     1  --
     2  -- PostgreSQL database dump
     3  --
     4  
     5  SET statement_timeout = 0;
     6  SET lock_timeout = 0;
     7  SET client_encoding = 'UTF8';
     8  SET standard_conforming_strings = on;
     9  SELECT pg_catalog.set_config('search_path', '', false);
    10  SET check_function_bodies = false;
    11  SET client_min_messages = warning;
    12  
    13  --
    14  -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: 
    15  --
    16  
    17  CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
    18  
    19  
    20  --
    21  -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: 
    22  --
    23  
    24  COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
    25  
    26  
    27  SET default_tablespace = '';
    28  
    29  SET default_with_oids = false;
    30  
    31  --
    32  -- Name: audits; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
    33  --
    34  
    35  CREATE TABLE public.audits (
    36      id character varying(26) NOT NULL,
    37      createat bigint,
    38      userid character varying(26),
    39      action character varying(512),
    40      extrainfo character varying(1024),
    41      ipaddress character varying(64),
    42      sessionid character varying(26)
    43  );
    44  
    45  
    46  ALTER TABLE public.audits OWNER TO mmuser;
    47  
    48  --
    49  -- Name: channelmemberhistory; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
    50  --
    51  
    52  CREATE TABLE public.channelmemberhistory (
    53      channelid character varying(26) NOT NULL,
    54      userid character varying(26) NOT NULL,
    55      jointime bigint NOT NULL,
    56      leavetime bigint
    57  );
    58  
    59  
    60  ALTER TABLE public.channelmemberhistory OWNER TO mmuser;
    61  
    62  --
    63  -- Name: channelmembers; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
    64  --
    65  
    66  CREATE TABLE public.channelmembers (
    67      channelid character varying(26) NOT NULL,
    68      userid character varying(26) NOT NULL,
    69      roles character varying(64),
    70      lastviewedat bigint,
    71      msgcount bigint,
    72      mentioncount bigint,
    73      notifyprops character varying(2000),
    74      lastupdateat bigint,
    75      schemeuser boolean,
    76      schemeadmin boolean
    77  );
    78  
    79  
    80  ALTER TABLE public.channelmembers OWNER TO mmuser;
    81  
    82  --
    83  -- Name: channels; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
    84  --
    85  
    86  CREATE TABLE public.channels (
    87      id character varying(26) NOT NULL,
    88      createat bigint,
    89      updateat bigint,
    90      deleteat bigint,
    91      teamid character varying(26),
    92      type character varying(1),
    93      displayname character varying(64),
    94      name character varying(64),
    95      header character varying(1024),
    96      purpose character varying(250),
    97      lastpostat bigint,
    98      totalmsgcount bigint,
    99      extraupdateat bigint,
   100      creatorid character varying(26),
   101      schemeid character varying(26)
   102  );
   103  
   104  
   105  ALTER TABLE public.channels OWNER TO mmuser;
   106  
   107  --
   108  -- Name: clusterdiscovery; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   109  --
   110  
   111  CREATE TABLE public.clusterdiscovery (
   112      id character varying(26) NOT NULL,
   113      type character varying(64),
   114      clustername character varying(64),
   115      hostname character varying(512),
   116      gossipport integer,
   117      port integer,
   118      createat bigint,
   119      lastpingat bigint
   120  );
   121  
   122  
   123  ALTER TABLE public.clusterdiscovery OWNER TO mmuser;
   124  
   125  --
   126  -- Name: commands; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   127  --
   128  
   129  CREATE TABLE public.commands (
   130      id character varying(26) NOT NULL,
   131      token character varying(26),
   132      createat bigint,
   133      updateat bigint,
   134      deleteat bigint,
   135      creatorid character varying(26),
   136      teamid character varying(26),
   137      trigger character varying(128),
   138      method character varying(1),
   139      username character varying(64),
   140      iconurl character varying(1024),
   141      autocomplete boolean,
   142      autocompletedesc character varying(1024),
   143      autocompletehint character varying(1024),
   144      displayname character varying(64),
   145      description character varying(128),
   146      url character varying(1024)
   147  );
   148  
   149  
   150  ALTER TABLE public.commands OWNER TO mmuser;
   151  
   152  --
   153  -- Name: commandwebhooks; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   154  --
   155  
   156  CREATE TABLE public.commandwebhooks (
   157      id character varying(26) NOT NULL,
   158      createat bigint,
   159      commandid character varying(26),
   160      userid character varying(26),
   161      channelid character varying(26),
   162      rootid character varying(26),
   163      parentid character varying(26),
   164      usecount integer
   165  );
   166  
   167  
   168  ALTER TABLE public.commandwebhooks OWNER TO mmuser;
   169  
   170  --
   171  -- Name: compliances; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   172  --
   173  
   174  CREATE TABLE public.compliances (
   175      id character varying(26) NOT NULL,
   176      createat bigint,
   177      userid character varying(26),
   178      status character varying(64),
   179      count integer,
   180      "desc" character varying(512),
   181      type character varying(64),
   182      startat bigint,
   183      endat bigint,
   184      keywords character varying(512),
   185      emails character varying(1024)
   186  );
   187  
   188  
   189  ALTER TABLE public.compliances OWNER TO mmuser;
   190  
   191  --
   192  -- Name: emoji; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   193  --
   194  
   195  CREATE TABLE public.emoji (
   196      id character varying(26) NOT NULL,
   197      createat bigint,
   198      updateat bigint,
   199      deleteat bigint,
   200      creatorid character varying(26),
   201      name character varying(64)
   202  );
   203  
   204  
   205  ALTER TABLE public.emoji OWNER TO mmuser;
   206  
   207  --
   208  -- Name: fileinfo; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   209  --
   210  
   211  CREATE TABLE public.fileinfo (
   212      id character varying(26) NOT NULL,
   213      creatorid character varying(26),
   214      postid character varying(26),
   215      createat bigint,
   216      updateat bigint,
   217      deleteat bigint,
   218      path character varying(512),
   219      thumbnailpath character varying(512),
   220      previewpath character varying(512),
   221      name character varying(256),
   222      extension character varying(64),
   223      size bigint,
   224      mimetype character varying(256),
   225      width integer,
   226      height integer,
   227      haspreviewimage boolean
   228  );
   229  
   230  
   231  ALTER TABLE public.fileinfo OWNER TO mmuser;
   232  
   233  --
   234  -- Name: incomingwebhooks; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   235  --
   236  
   237  CREATE TABLE public.incomingwebhooks (
   238      id character varying(26) NOT NULL,
   239      createat bigint,
   240      updateat bigint,
   241      deleteat bigint,
   242      userid character varying(26),
   243      channelid character varying(26),
   244      teamid character varying(26),
   245      displayname character varying(64),
   246      description character varying(128),
   247      username text,
   248      iconurl text,
   249      channellocked boolean
   250  );
   251  
   252  
   253  ALTER TABLE public.incomingwebhooks OWNER TO mmuser;
   254  
   255  --
   256  -- Name: jobs; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   257  --
   258  
   259  CREATE TABLE public.jobs (
   260      id character varying(26) NOT NULL,
   261      type character varying(32),
   262      priority bigint,
   263      createat bigint,
   264      startat bigint,
   265      lastactivityat bigint,
   266      status character varying(32),
   267      progress bigint,
   268      data character varying(1024)
   269  );
   270  
   271  
   272  ALTER TABLE public.jobs OWNER TO mmuser;
   273  
   274  --
   275  -- Name: licenses; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   276  --
   277  
   278  CREATE TABLE public.licenses (
   279      id character varying(26) NOT NULL,
   280      createat bigint,
   281      bytes character varying(10000)
   282  );
   283  
   284  
   285  ALTER TABLE public.licenses OWNER TO mmuser;
   286  
   287  --
   288  -- Name: oauthaccessdata; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   289  --
   290  
   291  CREATE TABLE public.oauthaccessdata (
   292      clientid character varying(26),
   293      userid character varying(26),
   294      token character varying(26) NOT NULL,
   295      refreshtoken character varying(26),
   296      redirecturi character varying(256),
   297      expiresat bigint,
   298      scope character varying(128)
   299  );
   300  
   301  
   302  ALTER TABLE public.oauthaccessdata OWNER TO mmuser;
   303  
   304  --
   305  -- Name: oauthapps; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   306  --
   307  
   308  CREATE TABLE public.oauthapps (
   309      id character varying(26) NOT NULL,
   310      creatorid character varying(26),
   311      createat bigint,
   312      updateat bigint,
   313      clientsecret character varying(128),
   314      name character varying(64),
   315      description character varying(512),
   316      iconurl character varying(512),
   317      callbackurls character varying(1024),
   318      homepage character varying(256),
   319      istrusted boolean
   320  );
   321  
   322  
   323  ALTER TABLE public.oauthapps OWNER TO mmuser;
   324  
   325  --
   326  -- Name: oauthauthdata; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   327  --
   328  
   329  CREATE TABLE public.oauthauthdata (
   330      clientid character varying(26),
   331      userid character varying(26),
   332      code character varying(128) NOT NULL,
   333      expiresin integer,
   334      createat bigint,
   335      redirecturi character varying(256),
   336      state character varying(1024),
   337      scope character varying(128)
   338  );
   339  
   340  
   341  ALTER TABLE public.oauthauthdata OWNER TO mmuser;
   342  
   343  --
   344  -- Name: outgoingwebhooks; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   345  --
   346  
   347  CREATE TABLE public.outgoingwebhooks (
   348      id character varying(26) NOT NULL,
   349      token character varying(26),
   350      createat bigint,
   351      updateat bigint,
   352      deleteat bigint,
   353      creatorid character varying(26),
   354      channelid character varying(26),
   355      teamid character varying(26),
   356      triggerwords character varying(1024),
   357      triggerwhen integer,
   358      callbackurls character varying(1024),
   359      displayname character varying(64),
   360      description character varying(128),
   361      contenttype character varying(128)
   362  );
   363  
   364  
   365  ALTER TABLE public.outgoingwebhooks OWNER TO mmuser;
   366  
   367  --
   368  -- Name: pluginkeyvaluestore; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   369  --
   370  
   371  CREATE TABLE public.pluginkeyvaluestore (
   372      pluginid character varying(190) NOT NULL,
   373      pkey character varying(50) NOT NULL,
   374      pvalue bytea
   375  );
   376  
   377  
   378  ALTER TABLE public.pluginkeyvaluestore OWNER TO mmuser;
   379  
   380  --
   381  -- Name: posts; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   382  --
   383  
   384  CREATE TABLE public.posts (
   385      id character varying(26) NOT NULL,
   386      createat bigint,
   387      updateat bigint,
   388      editat bigint,
   389      deleteat bigint,
   390      ispinned boolean,
   391      userid character varying(26),
   392      channelid character varying(26),
   393      rootid character varying(26),
   394      parentid character varying(26),
   395      originalid character varying(26),
   396      message character varying(65535),
   397      type character varying(26),
   398      props character varying(8000),
   399      hashtags character varying(1000),
   400      filenames character varying(4000),
   401      fileids character varying(300),
   402      hasreactions boolean
   403  );
   404  
   405  
   406  ALTER TABLE public.posts OWNER TO mmuser;
   407  
   408  --
   409  -- Name: preferences; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   410  --
   411  
   412  CREATE TABLE public.preferences (
   413      userid character varying(26) NOT NULL,
   414      category character varying(32) NOT NULL,
   415      name character varying(32) NOT NULL,
   416      value character varying(2000)
   417  );
   418  
   419  
   420  ALTER TABLE public.preferences OWNER TO mmuser;
   421  
   422  --
   423  -- Name: reactions; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   424  --
   425  
   426  CREATE TABLE public.reactions (
   427      userid character varying(26) NOT NULL,
   428      postid character varying(26) NOT NULL,
   429      emojiname character varying(64) NOT NULL,
   430      createat bigint
   431  );
   432  
   433  
   434  ALTER TABLE public.reactions OWNER TO mmuser;
   435  
   436  --
   437  -- Name: roles; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   438  --
   439  
   440  CREATE TABLE public.roles (
   441      id character varying(26) NOT NULL,
   442      name character varying(64),
   443      displayname character varying(128),
   444      description character varying(1024),
   445      createat bigint,
   446      updateat bigint,
   447      deleteat bigint,
   448      permissions character varying(4096),
   449      schememanaged boolean,
   450      builtin boolean
   451  );
   452  
   453  
   454  ALTER TABLE public.roles OWNER TO mmuser;
   455  
   456  --
   457  -- Name: schemes; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   458  --
   459  
   460  CREATE TABLE public.schemes (
   461      id character varying(26) NOT NULL,
   462      name character varying(64),
   463      displayname character varying(128),
   464      description character varying(1024),
   465      createat bigint,
   466      updateat bigint,
   467      deleteat bigint,
   468      scope character varying(32),
   469      defaultteamadminrole character varying(64),
   470      defaultteamuserrole character varying(64),
   471      defaultchanneladminrole character varying(64),
   472      defaultchanneluserrole character varying(64)
   473  );
   474  
   475  
   476  ALTER TABLE public.schemes OWNER TO mmuser;
   477  
   478  --
   479  -- Name: sessions; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   480  --
   481  
   482  CREATE TABLE public.sessions (
   483      id character varying(26) NOT NULL,
   484      token character varying(26),
   485      createat bigint,
   486      expiresat bigint,
   487      lastactivityat bigint,
   488      userid character varying(26),
   489      deviceid character varying(512),
   490      roles character varying(64),
   491      isoauth boolean,
   492      expirednotify boolean,
   493      props character varying(1000),
   494  );
   495  
   496  
   497  ALTER TABLE public.sessions OWNER TO mmuser;
   498  
   499  --
   500  -- Name: status; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   501  --
   502  
   503  CREATE TABLE public.status (
   504      userid character varying(26) NOT NULL,
   505      status character varying(32),
   506      manual boolean,
   507      lastactivityat bigint
   508  );
   509  
   510  
   511  ALTER TABLE public.status OWNER TO mmuser;
   512  
   513  --
   514  -- Name: systems; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   515  --
   516  
   517  CREATE TABLE public.systems (
   518      name character varying(64) NOT NULL,
   519      value character varying(1024)
   520  );
   521  
   522  
   523  ALTER TABLE public.systems OWNER TO mmuser;
   524  
   525  --
   526  -- Name: teammembers; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   527  --
   528  
   529  CREATE TABLE public.teammembers (
   530      teamid character varying(26) NOT NULL,
   531      userid character varying(26) NOT NULL,
   532      roles character varying(64),
   533      deleteat bigint,
   534      schemeuser boolean,
   535      schemeadmin boolean
   536  );
   537  
   538  
   539  ALTER TABLE public.teammembers OWNER TO mmuser;
   540  
   541  --
   542  -- Name: teams; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   543  --
   544  
   545  CREATE TABLE public.teams (
   546      id character varying(26) NOT NULL,
   547      createat bigint,
   548      updateat bigint,
   549      deleteat bigint,
   550      displayname character varying(64),
   551      name character varying(64),
   552      description character varying(255),
   553      email character varying(128),
   554      type text,
   555      companyname character varying(64),
   556      alloweddomains character varying(500),
   557      inviteid character varying(32),
   558      allowopeninvite boolean,
   559      lastteamiconupdate bigint,
   560      schemeid text
   561  );
   562  
   563  
   564  ALTER TABLE public.teams OWNER TO mmuser;
   565  
   566  --
   567  -- Name: tokens; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   568  --
   569  
   570  CREATE TABLE public.tokens (
   571      token character varying(64) NOT NULL,
   572      createat bigint,
   573      type character varying(64),
   574      extra character varying(128)
   575  );
   576  
   577  
   578  ALTER TABLE public.tokens OWNER TO mmuser;
   579  
   580  --
   581  -- Name: useraccesstokens; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   582  --
   583  
   584  CREATE TABLE public.useraccesstokens (
   585      id character varying(26) NOT NULL,
   586      token character varying(26),
   587      userid character varying(26),
   588      description character varying(512),
   589      isactive boolean
   590  );
   591  
   592  
   593  ALTER TABLE public.useraccesstokens OWNER TO mmuser;
   594  
   595  --
   596  -- Name: users; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   597  --
   598  
   599  CREATE TABLE public.users (
   600      id character varying(26) NOT NULL,
   601      createat bigint,
   602      updateat bigint,
   603      deleteat bigint,
   604      username character varying(64),
   605      password character varying(128),
   606      authdata character varying(128),
   607      authservice character varying(32),
   608      email character varying(128),
   609      emailverified boolean,
   610      nickname character varying(64),
   611      firstname character varying(64),
   612      lastname character varying(64),
   613      "position" character varying(128),
   614      roles character varying(256),
   615      allowmarketing boolean,
   616      props character varying(4000),
   617      notifyprops character varying(2000),
   618      lastpasswordupdate bigint,
   619      lastpictureupdate bigint,
   620      failedattempts integer,
   621      locale character varying(5),
   622      timezone character varying(256),
   623      mfaactive boolean,
   624      mfasecret character varying(128)
   625  );
   626  
   627  
   628  ALTER TABLE public.users OWNER TO mmuser;
   629  
   630  --
   631  -- Data for Name: audits; Type: TABLE DATA; Schema: public; Owner: mmuser
   632  --
   633  
   634  COPY public.audits (id, createat, userid, action, extrainfo, ipaddress, sessionid) FROM stdin;
   635  \.
   636  
   637  
   638  --
   639  -- Data for Name: channelmemberhistory; Type: TABLE DATA; Schema: public; Owner: mmuser
   640  --
   641  
   642  COPY public.channelmemberhistory (channelid, userid, jointime, leavetime) FROM stdin;
   643  \.
   644  
   645  
   646  --
   647  -- Data for Name: channelmembers; Type: TABLE DATA; Schema: public; Owner: mmuser
   648  --
   649  
   650  COPY public.channelmembers (channelid, userid, roles, lastviewedat, msgcount, mentioncount, notifyprops, lastupdateat, schemeuser, schemeadmin) FROM stdin;
   651  \.
   652  
   653  
   654  --
   655  -- Data for Name: channels; Type: TABLE DATA; Schema: public; Owner: mmuser
   656  --
   657  
   658  COPY public.channels (id, createat, updateat, deleteat, teamid, type, displayname, name, header, purpose, lastpostat, totalmsgcount, extraupdateat, creatorid, schemeid) FROM stdin;
   659  \.
   660  
   661  
   662  --
   663  -- Data for Name: clusterdiscovery; Type: TABLE DATA; Schema: public; Owner: mmuser
   664  --
   665  
   666  COPY public.clusterdiscovery (id, type, clustername, hostname, gossipport, port, createat, lastpingat) FROM stdin;
   667  \.
   668  
   669  
   670  --
   671  -- Data for Name: commands; Type: TABLE DATA; Schema: public; Owner: mmuser
   672  --
   673  
   674  COPY public.commands (id, token, createat, updateat, deleteat, creatorid, teamid, trigger, method, username, iconurl, autocomplete, autocompletedesc, autocompletehint, displayname, description, url) FROM stdin;
   675  \.
   676  
   677  
   678  --
   679  -- Data for Name: commandwebhooks; Type: TABLE DATA; Schema: public; Owner: mmuser
   680  --
   681  
   682  COPY public.commandwebhooks (id, createat, commandid, userid, channelid, rootid, parentid, usecount) FROM stdin;
   683  \.
   684  
   685  
   686  --
   687  -- Data for Name: compliances; Type: TABLE DATA; Schema: public; Owner: mmuser
   688  --
   689  
   690  COPY public.compliances (id, createat, userid, status, count, "desc", type, startat, endat, keywords, emails) FROM stdin;
   691  \.
   692  
   693  
   694  --
   695  -- Data for Name: emoji; Type: TABLE DATA; Schema: public; Owner: mmuser
   696  --
   697  
   698  COPY public.emoji (id, createat, updateat, deleteat, creatorid, name) FROM stdin;
   699  \.
   700  
   701  
   702  --
   703  -- Data for Name: fileinfo; Type: TABLE DATA; Schema: public; Owner: mmuser
   704  --
   705  
   706  COPY public.fileinfo (id, creatorid, postid, createat, updateat, deleteat, path, thumbnailpath, previewpath, name, extension, size, mimetype, width, height, haspreviewimage) FROM stdin;
   707  \.
   708  
   709  
   710  --
   711  -- Data for Name: incomingwebhooks; Type: TABLE DATA; Schema: public; Owner: mmuser
   712  --
   713  
   714  COPY public.incomingwebhooks (id, createat, updateat, deleteat, userid, channelid, teamid, displayname, description, username, iconurl, channellocked) FROM stdin;
   715  \.
   716  
   717  
   718  --
   719  -- Data for Name: jobs; Type: TABLE DATA; Schema: public; Owner: mmuser
   720  --
   721  
   722  COPY public.jobs (id, type, priority, createat, startat, lastactivityat, status, progress, data) FROM stdin;
   723  \.
   724  
   725  
   726  --
   727  -- Data for Name: licenses; Type: TABLE DATA; Schema: public; Owner: mmuser
   728  --
   729  
   730  COPY public.licenses (id, createat, bytes) FROM stdin;
   731  \.
   732  
   733  
   734  --
   735  -- Data for Name: oauthaccessdata; Type: TABLE DATA; Schema: public; Owner: mmuser
   736  --
   737  
   738  COPY public.oauthaccessdata (clientid, userid, token, refreshtoken, redirecturi, expiresat, scope) FROM stdin;
   739  \.
   740  
   741  
   742  --
   743  -- Data for Name: oauthapps; Type: TABLE DATA; Schema: public; Owner: mmuser
   744  --
   745  
   746  COPY public.oauthapps (id, creatorid, createat, updateat, clientsecret, name, description, iconurl, callbackurls, homepage, istrusted) FROM stdin;
   747  \.
   748  
   749  
   750  --
   751  -- Data for Name: oauthauthdata; Type: TABLE DATA; Schema: public; Owner: mmuser
   752  --
   753  
   754  COPY public.oauthauthdata (clientid, userid, code, expiresin, createat, redirecturi, state, scope) FROM stdin;
   755  \.
   756  
   757  
   758  --
   759  -- Data for Name: outgoingwebhooks; Type: TABLE DATA; Schema: public; Owner: mmuser
   760  --
   761  
   762  COPY public.outgoingwebhooks (id, token, createat, updateat, deleteat, creatorid, channelid, teamid, triggerwords, triggerwhen, callbackurls, displayname, description, contenttype) FROM stdin;
   763  \.
   764  
   765  
   766  --
   767  -- Data for Name: pluginkeyvaluestore; Type: TABLE DATA; Schema: public; Owner: mmuser
   768  --
   769  
   770  COPY public.pluginkeyvaluestore (pluginid, pkey, pvalue) FROM stdin;
   771  \.
   772  
   773  
   774  --
   775  -- Data for Name: posts; Type: TABLE DATA; Schema: public; Owner: mmuser
   776  --
   777  
   778  COPY public.posts (id, createat, updateat, editat, deleteat, ispinned, userid, channelid, rootid, parentid, originalid, message, type, props, hashtags, filenames, fileids, hasreactions) FROM stdin;
   779  \.
   780  
   781  
   782  --
   783  -- Data for Name: preferences; Type: TABLE DATA; Schema: public; Owner: mmuser
   784  --
   785  
   786  COPY public.preferences (userid, category, name, value) FROM stdin;
   787  \.
   788  
   789  
   790  --
   791  -- Data for Name: reactions; Type: TABLE DATA; Schema: public; Owner: mmuser
   792  --
   793  
   794  COPY public.reactions (userid, postid, emojiname, createat) FROM stdin;
   795  \.
   796  
   797  
   798  --
   799  -- Data for Name: roles; Type: TABLE DATA; Schema: public; Owner: mmuser
   800  --
   801  
   802  COPY public.roles (id, name, displayname, description, createat, updateat, deleteat, permissions, schememanaged, builtin) FROM stdin;
   803  aap88jdt37dgdgkek1c7dq69ua	team_post_all	authentication.roles.team_post_all.name	authentication.roles.team_post_all.description	1552912816230	1552912816230	0	 create_post	f	t
   804  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
   805  ufy3o8h1y3g4bgqeyw7yb6hrwe	system_post_all	authentication.roles.system_post_all.name	authentication.roles.system_post_all.description	1552912816269	1552912816269	0	 create_post	f	t
   806  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
   807  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
   808  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
   809  xjxw3p6ect8bjfre7wc5jhwbqr	channel_admin	authentication.roles.channel_admin.name	authentication.roles.channel_admin.description	1552912816669	1552912816669	0	 manage_channel_roles	t	t
   810  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
   811  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
   812  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
   813  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
   814  \.
   815  
   816  
   817  --
   818  -- Data for Name: schemes; Type: TABLE DATA; Schema: public; Owner: mmuser
   819  --
   820  
   821  COPY public.schemes (id, name, displayname, description, createat, updateat, deleteat, scope, defaultteamadminrole, defaultteamuserrole, defaultchanneladminrole, defaultchanneluserrole) FROM stdin;
   822  \.
   823  
   824  
   825  --
   826  -- Data for Name: sessions; Type: TABLE DATA; Schema: public; Owner: mmuser
   827  --
   828  
   829  COPY public.sessions (id, token, createat, expiresat, lastactivityat, userid, deviceid, roles, isoauth, expirednotify, props) FROM stdin;
   830  \.
   831  
   832  
   833  --
   834  -- Data for Name: status; Type: TABLE DATA; Schema: public; Owner: mmuser
   835  --
   836  
   837  COPY public.status (userid, status, manual, lastactivityat) FROM stdin;
   838  \.
   839  
   840  
   841  --
   842  -- Data for Name: systems; Type: TABLE DATA; Schema: public; Owner: mmuser
   843  --
   844  
   845  COPY public.systems (name, value) FROM stdin;
   846  Version	5.0.0
   847  AsymmetricSigningKey	{"ecdsa_key":{"curve":"P-256","x":50494983991025284560870211683226455202411615657166048251398890171377825517363,"y":113694733845764674468191147267904180878076486503487433150108745296643202957034,"d":85042364128488616037616885822024419913274924562562115600648814391088417875310}}
   848  AdvancedPermissionsMigrationComplete	true
   849  EmojisPermissionsMigrationComplete	true
   850  DiagnosticId	up3o75jkjbbs8dbawiwypzwrmc
   851  LastSecurityTime	1552912819442
   852  \.
   853  
   854  
   855  --
   856  -- Data for Name: teammembers; Type: TABLE DATA; Schema: public; Owner: mmuser
   857  --
   858  
   859  COPY public.teammembers (teamid, userid, roles, deleteat, schemeuser, schemeadmin) FROM stdin;
   860  \.
   861  
   862  
   863  --
   864  -- Data for Name: teams; Type: TABLE DATA; Schema: public; Owner: mmuser
   865  --
   866  
   867  COPY public.teams (id, createat, updateat, deleteat, displayname, name, description, email, type, companyname, alloweddomains, inviteid, allowopeninvite, lastteamiconupdate, schemeid) FROM stdin;
   868  \.
   869  
   870  
   871  --
   872  -- Data for Name: tokens; Type: TABLE DATA; Schema: public; Owner: mmuser
   873  --
   874  
   875  COPY public.tokens (token, createat, type, extra) FROM stdin;
   876  \.
   877  
   878  
   879  --
   880  -- Data for Name: useraccesstokens; Type: TABLE DATA; Schema: public; Owner: mmuser
   881  --
   882  
   883  COPY public.useraccesstokens (id, token, userid, description, isactive) FROM stdin;
   884  \.
   885  
   886  
   887  --
   888  -- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: mmuser
   889  --
   890  
   891  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;
   892  \.
   893  
   894  
   895  --
   896  -- Name: audits_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   897  --
   898  
   899  ALTER TABLE ONLY public.audits
   900      ADD CONSTRAINT audits_pkey PRIMARY KEY (id);
   901  
   902  
   903  --
   904  -- Name: channelmemberhistory_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   905  --
   906  
   907  ALTER TABLE ONLY public.channelmemberhistory
   908      ADD CONSTRAINT channelmemberhistory_pkey PRIMARY KEY (channelid, userid, jointime);
   909  
   910  
   911  --
   912  -- Name: channelmembers_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   913  --
   914  
   915  ALTER TABLE ONLY public.channelmembers
   916      ADD CONSTRAINT channelmembers_pkey PRIMARY KEY (channelid, userid);
   917  
   918  
   919  --
   920  -- Name: channels_name_teamid_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   921  --
   922  
   923  ALTER TABLE ONLY public.channels
   924      ADD CONSTRAINT channels_name_teamid_key UNIQUE (name, teamid);
   925  
   926  
   927  --
   928  -- Name: channels_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   929  --
   930  
   931  ALTER TABLE ONLY public.channels
   932      ADD CONSTRAINT channels_pkey PRIMARY KEY (id);
   933  
   934  
   935  --
   936  -- Name: clusterdiscovery_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   937  --
   938  
   939  ALTER TABLE ONLY public.clusterdiscovery
   940      ADD CONSTRAINT clusterdiscovery_pkey PRIMARY KEY (id);
   941  
   942  
   943  --
   944  -- Name: commands_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   945  --
   946  
   947  ALTER TABLE ONLY public.commands
   948      ADD CONSTRAINT commands_pkey PRIMARY KEY (id);
   949  
   950  
   951  --
   952  -- Name: commandwebhooks_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   953  --
   954  
   955  ALTER TABLE ONLY public.commandwebhooks
   956      ADD CONSTRAINT commandwebhooks_pkey PRIMARY KEY (id);
   957  
   958  
   959  --
   960  -- Name: compliances_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   961  --
   962  
   963  ALTER TABLE ONLY public.compliances
   964      ADD CONSTRAINT compliances_pkey PRIMARY KEY (id);
   965  
   966  
   967  --
   968  -- Name: emoji_name_deleteat_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   969  --
   970  
   971  ALTER TABLE ONLY public.emoji
   972      ADD CONSTRAINT emoji_name_deleteat_key UNIQUE (name, deleteat);
   973  
   974  
   975  --
   976  -- Name: emoji_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   977  --
   978  
   979  ALTER TABLE ONLY public.emoji
   980      ADD CONSTRAINT emoji_pkey PRIMARY KEY (id);
   981  
   982  
   983  --
   984  -- Name: fileinfo_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   985  --
   986  
   987  ALTER TABLE ONLY public.fileinfo
   988      ADD CONSTRAINT fileinfo_pkey PRIMARY KEY (id);
   989  
   990  
   991  --
   992  -- Name: incomingwebhooks_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   993  --
   994  
   995  ALTER TABLE ONLY public.incomingwebhooks
   996      ADD CONSTRAINT incomingwebhooks_pkey PRIMARY KEY (id);
   997  
   998  
   999  --
  1000  -- Name: jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1001  --
  1002  
  1003  ALTER TABLE ONLY public.jobs
  1004      ADD CONSTRAINT jobs_pkey PRIMARY KEY (id);
  1005  
  1006  
  1007  --
  1008  -- Name: licenses_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1009  --
  1010  
  1011  ALTER TABLE ONLY public.licenses
  1012      ADD CONSTRAINT licenses_pkey PRIMARY KEY (id);
  1013  
  1014  
  1015  --
  1016  -- Name: oauthaccessdata_clientid_userid_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1017  --
  1018  
  1019  ALTER TABLE ONLY public.oauthaccessdata
  1020      ADD CONSTRAINT oauthaccessdata_clientid_userid_key UNIQUE (clientid, userid);
  1021  
  1022  
  1023  --
  1024  -- Name: oauthaccessdata_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1025  --
  1026  
  1027  ALTER TABLE ONLY public.oauthaccessdata
  1028      ADD CONSTRAINT oauthaccessdata_pkey PRIMARY KEY (token);
  1029  
  1030  
  1031  --
  1032  -- Name: oauthapps_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1033  --
  1034  
  1035  ALTER TABLE ONLY public.oauthapps
  1036      ADD CONSTRAINT oauthapps_pkey PRIMARY KEY (id);
  1037  
  1038  
  1039  --
  1040  -- Name: oauthauthdata_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1041  --
  1042  
  1043  ALTER TABLE ONLY public.oauthauthdata
  1044      ADD CONSTRAINT oauthauthdata_pkey PRIMARY KEY (code);
  1045  
  1046  
  1047  --
  1048  -- Name: outgoingwebhooks_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1049  --
  1050  
  1051  ALTER TABLE ONLY public.outgoingwebhooks
  1052      ADD CONSTRAINT outgoingwebhooks_pkey PRIMARY KEY (id);
  1053  
  1054  
  1055  --
  1056  -- Name: pluginkeyvaluestore_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1057  --
  1058  
  1059  ALTER TABLE ONLY public.pluginkeyvaluestore
  1060      ADD CONSTRAINT pluginkeyvaluestore_pkey PRIMARY KEY (pluginid, pkey);
  1061  
  1062  
  1063  --
  1064  -- Name: posts_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1065  --
  1066  
  1067  ALTER TABLE ONLY public.posts
  1068      ADD CONSTRAINT posts_pkey PRIMARY KEY (id);
  1069  
  1070  
  1071  --
  1072  -- Name: preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1073  --
  1074  
  1075  ALTER TABLE ONLY public.preferences
  1076      ADD CONSTRAINT preferences_pkey PRIMARY KEY (userid, category, name);
  1077  
  1078  
  1079  --
  1080  -- Name: reactions_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1081  --
  1082  
  1083  ALTER TABLE ONLY public.reactions
  1084      ADD CONSTRAINT reactions_pkey PRIMARY KEY (postid, userid, emojiname);
  1085  
  1086  
  1087  --
  1088  -- Name: roles_name_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1089  --
  1090  
  1091  ALTER TABLE ONLY public.roles
  1092      ADD CONSTRAINT roles_name_key UNIQUE (name);
  1093  
  1094  
  1095  --
  1096  -- Name: roles_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1097  --
  1098  
  1099  ALTER TABLE ONLY public.roles
  1100      ADD CONSTRAINT roles_pkey PRIMARY KEY (id);
  1101  
  1102  
  1103  --
  1104  -- Name: schemes_name_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1105  --
  1106  
  1107  ALTER TABLE ONLY public.schemes
  1108      ADD CONSTRAINT schemes_name_key UNIQUE (name);
  1109  
  1110  
  1111  --
  1112  -- Name: schemes_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1113  --
  1114  
  1115  ALTER TABLE ONLY public.schemes
  1116      ADD CONSTRAINT schemes_pkey PRIMARY KEY (id);
  1117  
  1118  
  1119  --
  1120  -- Name: sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1121  --
  1122  
  1123  ALTER TABLE ONLY public.sessions
  1124      ADD CONSTRAINT sessions_pkey PRIMARY KEY (id);
  1125  
  1126  
  1127  --
  1128  -- Name: status_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1129  --
  1130  
  1131  ALTER TABLE ONLY public.status
  1132      ADD CONSTRAINT status_pkey PRIMARY KEY (userid);
  1133  
  1134  
  1135  --
  1136  -- Name: systems_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1137  --
  1138  
  1139  ALTER TABLE ONLY public.systems
  1140      ADD CONSTRAINT systems_pkey PRIMARY KEY (name);
  1141  
  1142  
  1143  --
  1144  -- Name: teammembers_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1145  --
  1146  
  1147  ALTER TABLE ONLY public.teammembers
  1148      ADD CONSTRAINT teammembers_pkey PRIMARY KEY (teamid, userid);
  1149  
  1150  
  1151  --
  1152  -- Name: teams_name_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1153  --
  1154  
  1155  ALTER TABLE ONLY public.teams
  1156      ADD CONSTRAINT teams_name_key UNIQUE (name);
  1157  
  1158  
  1159  --
  1160  -- Name: teams_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1161  --
  1162  
  1163  ALTER TABLE ONLY public.teams
  1164      ADD CONSTRAINT teams_pkey PRIMARY KEY (id);
  1165  
  1166  
  1167  --
  1168  -- Name: tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1169  --
  1170  
  1171  ALTER TABLE ONLY public.tokens
  1172      ADD CONSTRAINT tokens_pkey PRIMARY KEY (token);
  1173  
  1174  
  1175  --
  1176  -- Name: useraccesstokens_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1177  --
  1178  
  1179  ALTER TABLE ONLY public.useraccesstokens
  1180      ADD CONSTRAINT useraccesstokens_pkey PRIMARY KEY (id);
  1181  
  1182  
  1183  --
  1184  -- Name: useraccesstokens_token_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1185  --
  1186  
  1187  ALTER TABLE ONLY public.useraccesstokens
  1188      ADD CONSTRAINT useraccesstokens_token_key UNIQUE (token);
  1189  
  1190  
  1191  --
  1192  -- Name: users_authdata_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1193  --
  1194  
  1195  ALTER TABLE ONLY public.users
  1196      ADD CONSTRAINT users_authdata_key UNIQUE (authdata);
  1197  
  1198  
  1199  --
  1200  -- Name: users_email_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1201  --
  1202  
  1203  ALTER TABLE ONLY public.users
  1204      ADD CONSTRAINT users_email_key UNIQUE (email);
  1205  
  1206  
  1207  --
  1208  -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1209  --
  1210  
  1211  ALTER TABLE ONLY public.users
  1212      ADD CONSTRAINT users_pkey PRIMARY KEY (id);
  1213  
  1214  
  1215  --
  1216  -- Name: users_username_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1217  --
  1218  
  1219  ALTER TABLE ONLY public.users
  1220      ADD CONSTRAINT users_username_key UNIQUE (username);
  1221  
  1222  
  1223  --
  1224  -- Name: idx_audits_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1225  --
  1226  
  1227  CREATE INDEX idx_audits_user_id ON public.audits USING btree (userid);
  1228  
  1229  
  1230  --
  1231  -- Name: idx_channelmembers_channel_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1232  --
  1233  
  1234  CREATE INDEX idx_channelmembers_channel_id ON public.channelmembers USING btree (channelid);
  1235  
  1236  
  1237  --
  1238  -- Name: idx_channelmembers_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1239  --
  1240  
  1241  CREATE INDEX idx_channelmembers_user_id ON public.channelmembers USING btree (userid);
  1242  
  1243  
  1244  --
  1245  -- Name: idx_channels_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1246  --
  1247  
  1248  CREATE INDEX idx_channels_create_at ON public.channels USING btree (createat);
  1249  
  1250  
  1251  --
  1252  -- Name: idx_channels_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1253  --
  1254  
  1255  CREATE INDEX idx_channels_delete_at ON public.channels USING btree (deleteat);
  1256  
  1257  
  1258  --
  1259  -- Name: idx_channels_displayname_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1260  --
  1261  
  1262  CREATE INDEX idx_channels_displayname_lower ON public.channels USING btree (lower((displayname)::text));
  1263  
  1264  
  1265  --
  1266  -- Name: idx_channels_name; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1267  --
  1268  
  1269  CREATE INDEX idx_channels_name ON public.channels USING btree (name);
  1270  
  1271  
  1272  --
  1273  -- Name: idx_channels_name_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1274  --
  1275  
  1276  CREATE INDEX idx_channels_name_lower ON public.channels USING btree (lower((name)::text));
  1277  
  1278  
  1279  --
  1280  -- Name: idx_channels_team_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1281  --
  1282  
  1283  CREATE INDEX idx_channels_team_id ON public.channels USING btree (teamid);
  1284  
  1285  
  1286  --
  1287  -- Name: idx_channels_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1288  --
  1289  
  1290  CREATE INDEX idx_channels_txt ON public.channels USING gin (to_tsvector('english'::regconfig, (((name)::text || ' '::text) || (displayname)::text)));
  1291  
  1292  
  1293  --
  1294  -- Name: idx_channels_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1295  --
  1296  
  1297  CREATE INDEX idx_channels_update_at ON public.channels USING btree (updateat);
  1298  
  1299  
  1300  --
  1301  -- Name: idx_command_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1302  --
  1303  
  1304  CREATE INDEX idx_command_create_at ON public.commands USING btree (createat);
  1305  
  1306  
  1307  --
  1308  -- Name: idx_command_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1309  --
  1310  
  1311  CREATE INDEX idx_command_delete_at ON public.commands USING btree (deleteat);
  1312  
  1313  
  1314  --
  1315  -- Name: idx_command_team_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1316  --
  1317  
  1318  CREATE INDEX idx_command_team_id ON public.commands USING btree (teamid);
  1319  
  1320  
  1321  --
  1322  -- Name: idx_command_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1323  --
  1324  
  1325  CREATE INDEX idx_command_update_at ON public.commands USING btree (updateat);
  1326  
  1327  
  1328  --
  1329  -- Name: idx_command_webhook_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1330  --
  1331  
  1332  CREATE INDEX idx_command_webhook_create_at ON public.commandwebhooks USING btree (createat);
  1333  
  1334  
  1335  --
  1336  -- Name: idx_emoji_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1337  --
  1338  
  1339  CREATE INDEX idx_emoji_create_at ON public.emoji USING btree (createat);
  1340  
  1341  
  1342  --
  1343  -- Name: idx_emoji_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1344  --
  1345  
  1346  CREATE INDEX idx_emoji_delete_at ON public.emoji USING btree (deleteat);
  1347  
  1348  
  1349  --
  1350  -- Name: idx_emoji_name; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1351  --
  1352  
  1353  CREATE INDEX idx_emoji_name ON public.emoji USING btree (name);
  1354  
  1355  
  1356  --
  1357  -- Name: idx_emoji_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1358  --
  1359  
  1360  CREATE INDEX idx_emoji_update_at ON public.emoji USING btree (updateat);
  1361  
  1362  
  1363  --
  1364  -- Name: idx_fileinfo_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1365  --
  1366  
  1367  CREATE INDEX idx_fileinfo_create_at ON public.fileinfo USING btree (createat);
  1368  
  1369  
  1370  --
  1371  -- Name: idx_fileinfo_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1372  --
  1373  
  1374  CREATE INDEX idx_fileinfo_delete_at ON public.fileinfo USING btree (deleteat);
  1375  
  1376  
  1377  --
  1378  -- Name: idx_fileinfo_postid_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1379  --
  1380  
  1381  CREATE INDEX idx_fileinfo_postid_at ON public.fileinfo USING btree (postid);
  1382  
  1383  
  1384  --
  1385  -- Name: idx_fileinfo_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1386  --
  1387  
  1388  CREATE INDEX idx_fileinfo_update_at ON public.fileinfo USING btree (updateat);
  1389  
  1390  
  1391  --
  1392  -- Name: idx_incoming_webhook_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1393  --
  1394  
  1395  CREATE INDEX idx_incoming_webhook_create_at ON public.incomingwebhooks USING btree (createat);
  1396  
  1397  
  1398  --
  1399  -- Name: idx_incoming_webhook_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1400  --
  1401  
  1402  CREATE INDEX idx_incoming_webhook_delete_at ON public.incomingwebhooks USING btree (deleteat);
  1403  
  1404  
  1405  --
  1406  -- Name: idx_incoming_webhook_team_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1407  --
  1408  
  1409  CREATE INDEX idx_incoming_webhook_team_id ON public.incomingwebhooks USING btree (teamid);
  1410  
  1411  
  1412  --
  1413  -- Name: idx_incoming_webhook_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1414  --
  1415  
  1416  CREATE INDEX idx_incoming_webhook_update_at ON public.incomingwebhooks USING btree (updateat);
  1417  
  1418  
  1419  --
  1420  -- Name: idx_incoming_webhook_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1421  --
  1422  
  1423  CREATE INDEX idx_incoming_webhook_user_id ON public.incomingwebhooks USING btree (userid);
  1424  
  1425  
  1426  --
  1427  -- Name: idx_jobs_type; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1428  --
  1429  
  1430  CREATE INDEX idx_jobs_type ON public.jobs USING btree (type);
  1431  
  1432  
  1433  --
  1434  -- Name: idx_oauthaccessdata_client_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1435  --
  1436  
  1437  CREATE INDEX idx_oauthaccessdata_client_id ON public.oauthaccessdata USING btree (clientid);
  1438  
  1439  
  1440  --
  1441  -- Name: idx_oauthaccessdata_refresh_token; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1442  --
  1443  
  1444  CREATE INDEX idx_oauthaccessdata_refresh_token ON public.oauthaccessdata USING btree (refreshtoken);
  1445  
  1446  
  1447  --
  1448  -- Name: idx_oauthaccessdata_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1449  --
  1450  
  1451  CREATE INDEX idx_oauthaccessdata_user_id ON public.oauthaccessdata USING btree (userid);
  1452  
  1453  
  1454  --
  1455  -- Name: idx_oauthapps_creator_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1456  --
  1457  
  1458  CREATE INDEX idx_oauthapps_creator_id ON public.oauthapps USING btree (creatorid);
  1459  
  1460  
  1461  --
  1462  -- Name: idx_oauthauthdata_client_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1463  --
  1464  
  1465  CREATE INDEX idx_oauthauthdata_client_id ON public.oauthauthdata USING btree (code);
  1466  
  1467  
  1468  --
  1469  -- Name: idx_outgoing_webhook_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1470  --
  1471  
  1472  CREATE INDEX idx_outgoing_webhook_create_at ON public.outgoingwebhooks USING btree (createat);
  1473  
  1474  
  1475  --
  1476  -- Name: idx_outgoing_webhook_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1477  --
  1478  
  1479  CREATE INDEX idx_outgoing_webhook_delete_at ON public.outgoingwebhooks USING btree (deleteat);
  1480  
  1481  
  1482  --
  1483  -- Name: idx_outgoing_webhook_team_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1484  --
  1485  
  1486  CREATE INDEX idx_outgoing_webhook_team_id ON public.outgoingwebhooks USING btree (teamid);
  1487  
  1488  
  1489  --
  1490  -- Name: idx_outgoing_webhook_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1491  --
  1492  
  1493  CREATE INDEX idx_outgoing_webhook_update_at ON public.outgoingwebhooks USING btree (updateat);
  1494  
  1495  
  1496  --
  1497  -- Name: idx_posts_channel_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1498  --
  1499  
  1500  CREATE INDEX idx_posts_channel_id ON public.posts USING btree (channelid);
  1501  
  1502  
  1503  --
  1504  -- Name: idx_posts_channel_id_delete_at_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1505  --
  1506  
  1507  CREATE INDEX idx_posts_channel_id_delete_at_create_at ON public.posts USING btree (channelid, deleteat, createat);
  1508  
  1509  
  1510  --
  1511  -- Name: idx_posts_channel_id_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1512  --
  1513  
  1514  CREATE INDEX idx_posts_channel_id_update_at ON public.posts USING btree (channelid, updateat);
  1515  
  1516  
  1517  --
  1518  -- Name: idx_posts_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1519  --
  1520  
  1521  CREATE INDEX idx_posts_create_at ON public.posts USING btree (createat);
  1522  
  1523  
  1524  --
  1525  -- Name: idx_posts_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1526  --
  1527  
  1528  CREATE INDEX idx_posts_delete_at ON public.posts USING btree (deleteat);
  1529  
  1530  
  1531  --
  1532  -- Name: idx_posts_hashtags_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1533  --
  1534  
  1535  CREATE INDEX idx_posts_hashtags_txt ON public.posts USING gin (to_tsvector('english'::regconfig, (hashtags)::text));
  1536  
  1537  
  1538  --
  1539  -- Name: idx_posts_is_pinned; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1540  --
  1541  
  1542  CREATE INDEX idx_posts_is_pinned ON public.posts USING btree (ispinned);
  1543  
  1544  
  1545  --
  1546  -- Name: idx_posts_message_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1547  --
  1548  
  1549  CREATE INDEX idx_posts_message_txt ON public.posts USING gin (to_tsvector('english'::regconfig, (message)::text));
  1550  
  1551  
  1552  --
  1553  -- Name: idx_posts_root_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1554  --
  1555  
  1556  CREATE INDEX idx_posts_root_id ON public.posts USING btree (rootid);
  1557  
  1558  
  1559  --
  1560  -- Name: idx_posts_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1561  --
  1562  
  1563  CREATE INDEX idx_posts_update_at ON public.posts USING btree (updateat);
  1564  
  1565  
  1566  --
  1567  -- Name: idx_posts_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1568  --
  1569  
  1570  CREATE INDEX idx_posts_user_id ON public.posts USING btree (userid);
  1571  
  1572  
  1573  --
  1574  -- Name: idx_preferences_category; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1575  --
  1576  
  1577  CREATE INDEX idx_preferences_category ON public.preferences USING btree (category);
  1578  
  1579  
  1580  --
  1581  -- Name: idx_preferences_name; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1582  --
  1583  
  1584  CREATE INDEX idx_preferences_name ON public.preferences USING btree (name);
  1585  
  1586  
  1587  --
  1588  -- Name: idx_preferences_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1589  --
  1590  
  1591  CREATE INDEX idx_preferences_user_id ON public.preferences USING btree (userid);
  1592  
  1593  
  1594  --
  1595  -- Name: idx_sessions_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1596  --
  1597  
  1598  CREATE INDEX idx_sessions_create_at ON public.sessions USING btree (createat);
  1599  
  1600  
  1601  --
  1602  -- Name: idx_sessions_expires_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1603  --
  1604  
  1605  CREATE INDEX idx_sessions_expires_at ON public.sessions USING btree (expiresat);
  1606  
  1607  
  1608  --
  1609  -- Name: idx_sessions_last_activity_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1610  --
  1611  
  1612  CREATE INDEX idx_sessions_last_activity_at ON public.sessions USING btree (lastactivityat);
  1613  
  1614  
  1615  --
  1616  -- Name: idx_sessions_token; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1617  --
  1618  
  1619  CREATE INDEX idx_sessions_token ON public.sessions USING btree (token);
  1620  
  1621  
  1622  --
  1623  -- Name: idx_sessions_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1624  --
  1625  
  1626  CREATE INDEX idx_sessions_user_id ON public.sessions USING btree (userid);
  1627  
  1628  
  1629  --
  1630  -- Name: idx_status_status; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1631  --
  1632  
  1633  CREATE INDEX idx_status_status ON public.status USING btree (status);
  1634  
  1635  
  1636  --
  1637  -- Name: idx_status_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1638  --
  1639  
  1640  CREATE INDEX idx_status_user_id ON public.status USING btree (userid);
  1641  
  1642  
  1643  --
  1644  -- Name: idx_teammembers_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1645  --
  1646  
  1647  CREATE INDEX idx_teammembers_delete_at ON public.teammembers USING btree (deleteat);
  1648  
  1649  
  1650  --
  1651  -- Name: idx_teammembers_team_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1652  --
  1653  
  1654  CREATE INDEX idx_teammembers_team_id ON public.teammembers USING btree (teamid);
  1655  
  1656  
  1657  --
  1658  -- Name: idx_teammembers_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1659  --
  1660  
  1661  CREATE INDEX idx_teammembers_user_id ON public.teammembers USING btree (userid);
  1662  
  1663  
  1664  --
  1665  -- Name: idx_teams_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1666  --
  1667  
  1668  CREATE INDEX idx_teams_create_at ON public.teams USING btree (createat);
  1669  
  1670  
  1671  --
  1672  -- Name: idx_teams_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1673  --
  1674  
  1675  CREATE INDEX idx_teams_delete_at ON public.teams USING btree (deleteat);
  1676  
  1677  
  1678  --
  1679  -- Name: idx_teams_invite_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1680  --
  1681  
  1682  CREATE INDEX idx_teams_invite_id ON public.teams USING btree (inviteid);
  1683  
  1684  
  1685  --
  1686  -- Name: idx_teams_name; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1687  --
  1688  
  1689  CREATE INDEX idx_teams_name ON public.teams USING btree (name);
  1690  
  1691  
  1692  --
  1693  -- Name: idx_teams_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1694  --
  1695  
  1696  CREATE INDEX idx_teams_update_at ON public.teams USING btree (updateat);
  1697  
  1698  
  1699  --
  1700  -- Name: idx_user_access_tokens_token; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1701  --
  1702  
  1703  CREATE INDEX idx_user_access_tokens_token ON public.useraccesstokens USING btree (token);
  1704  
  1705  
  1706  --
  1707  -- Name: idx_user_access_tokens_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1708  --
  1709  
  1710  CREATE INDEX idx_user_access_tokens_user_id ON public.useraccesstokens USING btree (userid);
  1711  
  1712  
  1713  --
  1714  -- Name: idx_users_all_no_full_name_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1715  --
  1716  
  1717  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)));
  1718  
  1719  
  1720  --
  1721  -- Name: idx_users_all_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1722  --
  1723  
  1724  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)));
  1725  
  1726  
  1727  --
  1728  -- Name: idx_users_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1729  --
  1730  
  1731  CREATE INDEX idx_users_create_at ON public.users USING btree (createat);
  1732  
  1733  
  1734  --
  1735  -- Name: idx_users_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1736  --
  1737  
  1738  CREATE INDEX idx_users_delete_at ON public.users USING btree (deleteat);
  1739  
  1740  
  1741  --
  1742  -- Name: idx_users_email; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1743  --
  1744  
  1745  CREATE INDEX idx_users_email ON public.users USING btree (email);
  1746  
  1747  
  1748  --
  1749  -- Name: idx_users_email_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1750  --
  1751  
  1752  CREATE INDEX idx_users_email_lower ON public.users USING btree (lower((email)::text));
  1753  
  1754  
  1755  --
  1756  -- Name: idx_users_firstname_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1757  --
  1758  
  1759  CREATE INDEX idx_users_firstname_lower ON public.users USING btree (lower((firstname)::text));
  1760  
  1761  
  1762  --
  1763  -- Name: idx_users_lastname_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1764  --
  1765  
  1766  CREATE INDEX idx_users_lastname_lower ON public.users USING btree (lower((lastname)::text));
  1767  
  1768  
  1769  --
  1770  -- Name: idx_users_names_no_full_name_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1771  --
  1772  
  1773  CREATE INDEX idx_users_names_no_full_name_txt ON public.users USING gin (to_tsvector('english'::regconfig, (((username)::text || ' '::text) || (nickname)::text)));
  1774  
  1775  
  1776  --
  1777  -- Name: idx_users_names_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1778  --
  1779  
  1780  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)));
  1781  
  1782  
  1783  --
  1784  -- Name: idx_users_nickname_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1785  --
  1786  
  1787  CREATE INDEX idx_users_nickname_lower ON public.users USING btree (lower((nickname)::text));
  1788  
  1789  
  1790  --
  1791  -- Name: idx_users_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1792  --
  1793  
  1794  CREATE INDEX idx_users_update_at ON public.users USING btree (updateat);
  1795  
  1796  
  1797  --
  1798  -- Name: idx_users_username_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1799  --
  1800  
  1801  CREATE INDEX idx_users_username_lower ON public.users USING btree (lower((username)::text));
  1802  
  1803  
  1804  --
  1805  -- Name: SCHEMA public; Type: ACL; Schema: -; Owner: mmuser
  1806  --
  1807  
  1808  REVOKE ALL ON SCHEMA public FROM PUBLIC;
  1809  REVOKE ALL ON SCHEMA public FROM mmuser;
  1810  GRANT ALL ON SCHEMA public TO mmuser;
  1811  GRANT ALL ON SCHEMA public TO PUBLIC;
  1812  
  1813  
  1814  --
  1815  -- PostgreSQL database dump complete
  1816  --
  1817