github.com/larkox/mattermost-server@v5.11.1+incompatible/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(150),
   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      props character varying(1000)
   493  );
   494  
   495  
   496  ALTER TABLE public.sessions OWNER TO mmuser;
   497  
   498  --
   499  -- Name: status; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   500  --
   501  
   502  CREATE TABLE public.status (
   503      userid character varying(26) NOT NULL,
   504      status character varying(32),
   505      manual boolean,
   506      lastactivityat bigint
   507  );
   508  
   509  
   510  ALTER TABLE public.status OWNER TO mmuser;
   511  
   512  --
   513  -- Name: systems; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   514  --
   515  
   516  CREATE TABLE public.systems (
   517      name character varying(64) NOT NULL,
   518      value character varying(1024)
   519  );
   520  
   521  
   522  ALTER TABLE public.systems OWNER TO mmuser;
   523  
   524  --
   525  -- Name: teammembers; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   526  --
   527  
   528  CREATE TABLE public.teammembers (
   529      teamid character varying(26) NOT NULL,
   530      userid character varying(26) NOT NULL,
   531      roles character varying(64),
   532      deleteat bigint,
   533      schemeuser boolean,
   534      schemeadmin boolean
   535  );
   536  
   537  
   538  ALTER TABLE public.teammembers OWNER TO mmuser;
   539  
   540  --
   541  -- Name: teams; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   542  --
   543  
   544  CREATE TABLE public.teams (
   545      id character varying(26) NOT NULL,
   546      createat bigint,
   547      updateat bigint,
   548      deleteat bigint,
   549      displayname character varying(64),
   550      name character varying(64),
   551      description character varying(255),
   552      email character varying(128),
   553      type text,
   554      companyname character varying(64),
   555      alloweddomains character varying(500),
   556      inviteid character varying(32),
   557      allowopeninvite boolean,
   558      lastteamiconupdate bigint,
   559      schemeid text
   560  );
   561  
   562  
   563  ALTER TABLE public.teams OWNER TO mmuser;
   564  
   565  --
   566  -- Name: tokens; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   567  --
   568  
   569  CREATE TABLE public.tokens (
   570      token character varying(64) NOT NULL,
   571      createat bigint,
   572      type character varying(64),
   573      extra character varying(128)
   574  );
   575  
   576  
   577  ALTER TABLE public.tokens OWNER TO mmuser;
   578  
   579  --
   580  -- Name: useraccesstokens; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   581  --
   582  
   583  CREATE TABLE public.useraccesstokens (
   584      id character varying(26) NOT NULL,
   585      token character varying(26),
   586      userid character varying(26),
   587      description character varying(512),
   588      isactive boolean
   589  );
   590  
   591  
   592  ALTER TABLE public.useraccesstokens OWNER TO mmuser;
   593  
   594  --
   595  -- Name: users; Type: TABLE; Schema: public; Owner: mmuser; Tablespace: 
   596  --
   597  
   598  CREATE TABLE public.users (
   599      id character varying(26) NOT NULL,
   600      createat bigint,
   601      updateat bigint,
   602      deleteat bigint,
   603      username character varying(64),
   604      password character varying(128),
   605      authdata character varying(128),
   606      authservice character varying(32),
   607      email character varying(128),
   608      emailverified boolean,
   609      nickname character varying(64),
   610      firstname character varying(64),
   611      lastname character varying(64),
   612      "position" character varying(128),
   613      roles character varying(256),
   614      allowmarketing boolean,
   615      props character varying(4000),
   616      notifyprops character varying(2000),
   617      lastpasswordupdate bigint,
   618      lastpictureupdate bigint,
   619      failedattempts integer,
   620      locale character varying(5),
   621      timezone character varying(256),
   622      mfaactive boolean,
   623      mfasecret character varying(128)
   624  );
   625  
   626  
   627  ALTER TABLE public.users OWNER TO mmuser;
   628  
   629  --
   630  -- Data for Name: audits; Type: TABLE DATA; Schema: public; Owner: mmuser
   631  --
   632  
   633  COPY public.audits (id, createat, userid, action, extrainfo, ipaddress, sessionid) FROM stdin;
   634  \.
   635  
   636  
   637  --
   638  -- Data for Name: channelmemberhistory; Type: TABLE DATA; Schema: public; Owner: mmuser
   639  --
   640  
   641  COPY public.channelmemberhistory (channelid, userid, jointime, leavetime) FROM stdin;
   642  \.
   643  
   644  
   645  --
   646  -- Data for Name: channelmembers; Type: TABLE DATA; Schema: public; Owner: mmuser
   647  --
   648  
   649  COPY public.channelmembers (channelid, userid, roles, lastviewedat, msgcount, mentioncount, notifyprops, lastupdateat, schemeuser, schemeadmin) FROM stdin;
   650  \.
   651  
   652  
   653  --
   654  -- Data for Name: channels; Type: TABLE DATA; Schema: public; Owner: mmuser
   655  --
   656  
   657  COPY public.channels (id, createat, updateat, deleteat, teamid, type, displayname, name, header, purpose, lastpostat, totalmsgcount, extraupdateat, creatorid, schemeid) FROM stdin;
   658  \.
   659  
   660  
   661  --
   662  -- Data for Name: clusterdiscovery; Type: TABLE DATA; Schema: public; Owner: mmuser
   663  --
   664  
   665  COPY public.clusterdiscovery (id, type, clustername, hostname, gossipport, port, createat, lastpingat) FROM stdin;
   666  \.
   667  
   668  
   669  --
   670  -- Data for Name: commands; Type: TABLE DATA; Schema: public; Owner: mmuser
   671  --
   672  
   673  COPY public.commands (id, token, createat, updateat, deleteat, creatorid, teamid, trigger, method, username, iconurl, autocomplete, autocompletedesc, autocompletehint, displayname, description, url) FROM stdin;
   674  \.
   675  
   676  
   677  --
   678  -- Data for Name: commandwebhooks; Type: TABLE DATA; Schema: public; Owner: mmuser
   679  --
   680  
   681  COPY public.commandwebhooks (id, createat, commandid, userid, channelid, rootid, parentid, usecount) FROM stdin;
   682  \.
   683  
   684  
   685  --
   686  -- Data for Name: compliances; Type: TABLE DATA; Schema: public; Owner: mmuser
   687  --
   688  
   689  COPY public.compliances (id, createat, userid, status, count, "desc", type, startat, endat, keywords, emails) FROM stdin;
   690  \.
   691  
   692  
   693  --
   694  -- Data for Name: emoji; Type: TABLE DATA; Schema: public; Owner: mmuser
   695  --
   696  
   697  COPY public.emoji (id, createat, updateat, deleteat, creatorid, name) FROM stdin;
   698  \.
   699  
   700  
   701  --
   702  -- Data for Name: fileinfo; Type: TABLE DATA; Schema: public; Owner: mmuser
   703  --
   704  
   705  COPY public.fileinfo (id, creatorid, postid, createat, updateat, deleteat, path, thumbnailpath, previewpath, name, extension, size, mimetype, width, height, haspreviewimage) FROM stdin;
   706  \.
   707  
   708  
   709  --
   710  -- Data for Name: incomingwebhooks; Type: TABLE DATA; Schema: public; Owner: mmuser
   711  --
   712  
   713  COPY public.incomingwebhooks (id, createat, updateat, deleteat, userid, channelid, teamid, displayname, description, username, iconurl, channellocked) FROM stdin;
   714  \.
   715  
   716  
   717  --
   718  -- Data for Name: jobs; Type: TABLE DATA; Schema: public; Owner: mmuser
   719  --
   720  
   721  COPY public.jobs (id, type, priority, createat, startat, lastactivityat, status, progress, data) FROM stdin;
   722  \.
   723  
   724  
   725  --
   726  -- Data for Name: licenses; Type: TABLE DATA; Schema: public; Owner: mmuser
   727  --
   728  
   729  COPY public.licenses (id, createat, bytes) FROM stdin;
   730  \.
   731  
   732  
   733  --
   734  -- Data for Name: oauthaccessdata; Type: TABLE DATA; Schema: public; Owner: mmuser
   735  --
   736  
   737  COPY public.oauthaccessdata (clientid, userid, token, refreshtoken, redirecturi, expiresat, scope) FROM stdin;
   738  \.
   739  
   740  
   741  --
   742  -- Data for Name: oauthapps; Type: TABLE DATA; Schema: public; Owner: mmuser
   743  --
   744  
   745  COPY public.oauthapps (id, creatorid, createat, updateat, clientsecret, name, description, iconurl, callbackurls, homepage, istrusted) FROM stdin;
   746  \.
   747  
   748  
   749  --
   750  -- Data for Name: oauthauthdata; Type: TABLE DATA; Schema: public; Owner: mmuser
   751  --
   752  
   753  COPY public.oauthauthdata (clientid, userid, code, expiresin, createat, redirecturi, state, scope) FROM stdin;
   754  \.
   755  
   756  
   757  --
   758  -- Data for Name: outgoingwebhooks; Type: TABLE DATA; Schema: public; Owner: mmuser
   759  --
   760  
   761  COPY public.outgoingwebhooks (id, token, createat, updateat, deleteat, creatorid, channelid, teamid, triggerwords, triggerwhen, callbackurls, displayname, description, contenttype) FROM stdin;
   762  \.
   763  
   764  
   765  --
   766  -- Data for Name: pluginkeyvaluestore; Type: TABLE DATA; Schema: public; Owner: mmuser
   767  --
   768  
   769  COPY public.pluginkeyvaluestore (pluginid, pkey, pvalue) FROM stdin;
   770  \.
   771  
   772  
   773  --
   774  -- Data for Name: posts; Type: TABLE DATA; Schema: public; Owner: mmuser
   775  --
   776  
   777  COPY public.posts (id, createat, updateat, editat, deleteat, ispinned, userid, channelid, rootid, parentid, originalid, message, type, props, hashtags, filenames, fileids, hasreactions) FROM stdin;
   778  \.
   779  
   780  
   781  --
   782  -- Data for Name: preferences; Type: TABLE DATA; Schema: public; Owner: mmuser
   783  --
   784  
   785  COPY public.preferences (userid, category, name, value) FROM stdin;
   786  \.
   787  
   788  
   789  --
   790  -- Data for Name: reactions; Type: TABLE DATA; Schema: public; Owner: mmuser
   791  --
   792  
   793  COPY public.reactions (userid, postid, emojiname, createat) FROM stdin;
   794  \.
   795  
   796  
   797  --
   798  -- Data for Name: roles; Type: TABLE DATA; Schema: public; Owner: mmuser
   799  --
   800  
   801  COPY public.roles (id, name, displayname, description, createat, updateat, deleteat, permissions, schememanaged, builtin) FROM stdin;
   802  aap88jdt37dgdgkek1c7dq69ua	team_post_all	authentication.roles.team_post_all.name	authentication.roles.team_post_all.description	1552912816230	1552912816230	0	 create_post	f	t
   803  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
   804  ufy3o8h1y3g4bgqeyw7yb6hrwe	system_post_all	authentication.roles.system_post_all.name	authentication.roles.system_post_all.description	1552912816269	1552912816269	0	 create_post	f	t
   805  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
   806  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
   807  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
   808  xjxw3p6ect8bjfre7wc5jhwbqr	channel_admin	authentication.roles.channel_admin.name	authentication.roles.channel_admin.description	1552912816669	1552912816669	0	 manage_channel_roles	t	t
   809  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
   810  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
   811  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
   812  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
   813  \.
   814  
   815  
   816  --
   817  -- Data for Name: schemes; Type: TABLE DATA; Schema: public; Owner: mmuser
   818  --
   819  
   820  COPY public.schemes (id, name, displayname, description, createat, updateat, deleteat, scope, defaultteamadminrole, defaultteamuserrole, defaultchanneladminrole, defaultchanneluserrole) FROM stdin;
   821  \.
   822  
   823  
   824  --
   825  -- Data for Name: sessions; Type: TABLE DATA; Schema: public; Owner: mmuser
   826  --
   827  
   828  COPY public.sessions (id, token, createat, expiresat, lastactivityat, userid, deviceid, roles, isoauth, props) FROM stdin;
   829  \.
   830  
   831  
   832  --
   833  -- Data for Name: status; Type: TABLE DATA; Schema: public; Owner: mmuser
   834  --
   835  
   836  COPY public.status (userid, status, manual, lastactivityat) FROM stdin;
   837  \.
   838  
   839  
   840  --
   841  -- Data for Name: systems; Type: TABLE DATA; Schema: public; Owner: mmuser
   842  --
   843  
   844  COPY public.systems (name, value) FROM stdin;
   845  Version	5.0.0
   846  AsymmetricSigningKey	{"ecdsa_key":{"curve":"P-256","x":50494983991025284560870211683226455202411615657166048251398890171377825517363,"y":113694733845764674468191147267904180878076486503487433150108745296643202957034,"d":85042364128488616037616885822024419913274924562562115600648814391088417875310}}
   847  AdvancedPermissionsMigrationComplete	true
   848  EmojisPermissionsMigrationComplete	true
   849  DiagnosticId	up3o75jkjbbs8dbawiwypzwrmc
   850  LastSecurityTime	1552912819442
   851  \.
   852  
   853  
   854  --
   855  -- Data for Name: teammembers; Type: TABLE DATA; Schema: public; Owner: mmuser
   856  --
   857  
   858  COPY public.teammembers (teamid, userid, roles, deleteat, schemeuser, schemeadmin) FROM stdin;
   859  \.
   860  
   861  
   862  --
   863  -- Data for Name: teams; Type: TABLE DATA; Schema: public; Owner: mmuser
   864  --
   865  
   866  COPY public.teams (id, createat, updateat, deleteat, displayname, name, description, email, type, companyname, alloweddomains, inviteid, allowopeninvite, lastteamiconupdate, schemeid) FROM stdin;
   867  \.
   868  
   869  
   870  --
   871  -- Data for Name: tokens; Type: TABLE DATA; Schema: public; Owner: mmuser
   872  --
   873  
   874  COPY public.tokens (token, createat, type, extra) FROM stdin;
   875  \.
   876  
   877  
   878  --
   879  -- Data for Name: useraccesstokens; Type: TABLE DATA; Schema: public; Owner: mmuser
   880  --
   881  
   882  COPY public.useraccesstokens (id, token, userid, description, isactive) FROM stdin;
   883  \.
   884  
   885  
   886  --
   887  -- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: mmuser
   888  --
   889  
   890  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;
   891  \.
   892  
   893  
   894  --
   895  -- Name: audits_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   896  --
   897  
   898  ALTER TABLE ONLY public.audits
   899      ADD CONSTRAINT audits_pkey PRIMARY KEY (id);
   900  
   901  
   902  --
   903  -- Name: channelmemberhistory_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   904  --
   905  
   906  ALTER TABLE ONLY public.channelmemberhistory
   907      ADD CONSTRAINT channelmemberhistory_pkey PRIMARY KEY (channelid, userid, jointime);
   908  
   909  
   910  --
   911  -- Name: channelmembers_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   912  --
   913  
   914  ALTER TABLE ONLY public.channelmembers
   915      ADD CONSTRAINT channelmembers_pkey PRIMARY KEY (channelid, userid);
   916  
   917  
   918  --
   919  -- Name: channels_name_teamid_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   920  --
   921  
   922  ALTER TABLE ONLY public.channels
   923      ADD CONSTRAINT channels_name_teamid_key UNIQUE (name, teamid);
   924  
   925  
   926  --
   927  -- Name: channels_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   928  --
   929  
   930  ALTER TABLE ONLY public.channels
   931      ADD CONSTRAINT channels_pkey PRIMARY KEY (id);
   932  
   933  
   934  --
   935  -- Name: clusterdiscovery_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   936  --
   937  
   938  ALTER TABLE ONLY public.clusterdiscovery
   939      ADD CONSTRAINT clusterdiscovery_pkey PRIMARY KEY (id);
   940  
   941  
   942  --
   943  -- Name: commands_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   944  --
   945  
   946  ALTER TABLE ONLY public.commands
   947      ADD CONSTRAINT commands_pkey PRIMARY KEY (id);
   948  
   949  
   950  --
   951  -- Name: commandwebhooks_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   952  --
   953  
   954  ALTER TABLE ONLY public.commandwebhooks
   955      ADD CONSTRAINT commandwebhooks_pkey PRIMARY KEY (id);
   956  
   957  
   958  --
   959  -- Name: compliances_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   960  --
   961  
   962  ALTER TABLE ONLY public.compliances
   963      ADD CONSTRAINT compliances_pkey PRIMARY KEY (id);
   964  
   965  
   966  --
   967  -- Name: emoji_name_deleteat_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   968  --
   969  
   970  ALTER TABLE ONLY public.emoji
   971      ADD CONSTRAINT emoji_name_deleteat_key UNIQUE (name, deleteat);
   972  
   973  
   974  --
   975  -- Name: emoji_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   976  --
   977  
   978  ALTER TABLE ONLY public.emoji
   979      ADD CONSTRAINT emoji_pkey PRIMARY KEY (id);
   980  
   981  
   982  --
   983  -- Name: fileinfo_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   984  --
   985  
   986  ALTER TABLE ONLY public.fileinfo
   987      ADD CONSTRAINT fileinfo_pkey PRIMARY KEY (id);
   988  
   989  
   990  --
   991  -- Name: incomingwebhooks_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
   992  --
   993  
   994  ALTER TABLE ONLY public.incomingwebhooks
   995      ADD CONSTRAINT incomingwebhooks_pkey PRIMARY KEY (id);
   996  
   997  
   998  --
   999  -- Name: jobs_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1000  --
  1001  
  1002  ALTER TABLE ONLY public.jobs
  1003      ADD CONSTRAINT jobs_pkey PRIMARY KEY (id);
  1004  
  1005  
  1006  --
  1007  -- Name: licenses_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1008  --
  1009  
  1010  ALTER TABLE ONLY public.licenses
  1011      ADD CONSTRAINT licenses_pkey PRIMARY KEY (id);
  1012  
  1013  
  1014  --
  1015  -- Name: oauthaccessdata_clientid_userid_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1016  --
  1017  
  1018  ALTER TABLE ONLY public.oauthaccessdata
  1019      ADD CONSTRAINT oauthaccessdata_clientid_userid_key UNIQUE (clientid, userid);
  1020  
  1021  
  1022  --
  1023  -- Name: oauthaccessdata_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1024  --
  1025  
  1026  ALTER TABLE ONLY public.oauthaccessdata
  1027      ADD CONSTRAINT oauthaccessdata_pkey PRIMARY KEY (token);
  1028  
  1029  
  1030  --
  1031  -- Name: oauthapps_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1032  --
  1033  
  1034  ALTER TABLE ONLY public.oauthapps
  1035      ADD CONSTRAINT oauthapps_pkey PRIMARY KEY (id);
  1036  
  1037  
  1038  --
  1039  -- Name: oauthauthdata_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1040  --
  1041  
  1042  ALTER TABLE ONLY public.oauthauthdata
  1043      ADD CONSTRAINT oauthauthdata_pkey PRIMARY KEY (code);
  1044  
  1045  
  1046  --
  1047  -- Name: outgoingwebhooks_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1048  --
  1049  
  1050  ALTER TABLE ONLY public.outgoingwebhooks
  1051      ADD CONSTRAINT outgoingwebhooks_pkey PRIMARY KEY (id);
  1052  
  1053  
  1054  --
  1055  -- Name: pluginkeyvaluestore_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1056  --
  1057  
  1058  ALTER TABLE ONLY public.pluginkeyvaluestore
  1059      ADD CONSTRAINT pluginkeyvaluestore_pkey PRIMARY KEY (pluginid, pkey);
  1060  
  1061  
  1062  --
  1063  -- Name: posts_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1064  --
  1065  
  1066  ALTER TABLE ONLY public.posts
  1067      ADD CONSTRAINT posts_pkey PRIMARY KEY (id);
  1068  
  1069  
  1070  --
  1071  -- Name: preferences_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1072  --
  1073  
  1074  ALTER TABLE ONLY public.preferences
  1075      ADD CONSTRAINT preferences_pkey PRIMARY KEY (userid, category, name);
  1076  
  1077  
  1078  --
  1079  -- Name: reactions_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1080  --
  1081  
  1082  ALTER TABLE ONLY public.reactions
  1083      ADD CONSTRAINT reactions_pkey PRIMARY KEY (userid, postid, emojiname);
  1084  
  1085  
  1086  --
  1087  -- Name: roles_name_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1088  --
  1089  
  1090  ALTER TABLE ONLY public.roles
  1091      ADD CONSTRAINT roles_name_key UNIQUE (name);
  1092  
  1093  
  1094  --
  1095  -- Name: roles_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1096  --
  1097  
  1098  ALTER TABLE ONLY public.roles
  1099      ADD CONSTRAINT roles_pkey PRIMARY KEY (id);
  1100  
  1101  
  1102  --
  1103  -- Name: schemes_name_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1104  --
  1105  
  1106  ALTER TABLE ONLY public.schemes
  1107      ADD CONSTRAINT schemes_name_key UNIQUE (name);
  1108  
  1109  
  1110  --
  1111  -- Name: schemes_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1112  --
  1113  
  1114  ALTER TABLE ONLY public.schemes
  1115      ADD CONSTRAINT schemes_pkey PRIMARY KEY (id);
  1116  
  1117  
  1118  --
  1119  -- Name: sessions_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1120  --
  1121  
  1122  ALTER TABLE ONLY public.sessions
  1123      ADD CONSTRAINT sessions_pkey PRIMARY KEY (id);
  1124  
  1125  
  1126  --
  1127  -- Name: status_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1128  --
  1129  
  1130  ALTER TABLE ONLY public.status
  1131      ADD CONSTRAINT status_pkey PRIMARY KEY (userid);
  1132  
  1133  
  1134  --
  1135  -- Name: systems_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1136  --
  1137  
  1138  ALTER TABLE ONLY public.systems
  1139      ADD CONSTRAINT systems_pkey PRIMARY KEY (name);
  1140  
  1141  
  1142  --
  1143  -- Name: teammembers_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1144  --
  1145  
  1146  ALTER TABLE ONLY public.teammembers
  1147      ADD CONSTRAINT teammembers_pkey PRIMARY KEY (teamid, userid);
  1148  
  1149  
  1150  --
  1151  -- Name: teams_name_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1152  --
  1153  
  1154  ALTER TABLE ONLY public.teams
  1155      ADD CONSTRAINT teams_name_key UNIQUE (name);
  1156  
  1157  
  1158  --
  1159  -- Name: teams_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1160  --
  1161  
  1162  ALTER TABLE ONLY public.teams
  1163      ADD CONSTRAINT teams_pkey PRIMARY KEY (id);
  1164  
  1165  
  1166  --
  1167  -- Name: tokens_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1168  --
  1169  
  1170  ALTER TABLE ONLY public.tokens
  1171      ADD CONSTRAINT tokens_pkey PRIMARY KEY (token);
  1172  
  1173  
  1174  --
  1175  -- Name: useraccesstokens_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1176  --
  1177  
  1178  ALTER TABLE ONLY public.useraccesstokens
  1179      ADD CONSTRAINT useraccesstokens_pkey PRIMARY KEY (id);
  1180  
  1181  
  1182  --
  1183  -- Name: useraccesstokens_token_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1184  --
  1185  
  1186  ALTER TABLE ONLY public.useraccesstokens
  1187      ADD CONSTRAINT useraccesstokens_token_key UNIQUE (token);
  1188  
  1189  
  1190  --
  1191  -- Name: users_authdata_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1192  --
  1193  
  1194  ALTER TABLE ONLY public.users
  1195      ADD CONSTRAINT users_authdata_key UNIQUE (authdata);
  1196  
  1197  
  1198  --
  1199  -- Name: users_email_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1200  --
  1201  
  1202  ALTER TABLE ONLY public.users
  1203      ADD CONSTRAINT users_email_key UNIQUE (email);
  1204  
  1205  
  1206  --
  1207  -- Name: users_pkey; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1208  --
  1209  
  1210  ALTER TABLE ONLY public.users
  1211      ADD CONSTRAINT users_pkey PRIMARY KEY (id);
  1212  
  1213  
  1214  --
  1215  -- Name: users_username_key; Type: CONSTRAINT; Schema: public; Owner: mmuser; Tablespace: 
  1216  --
  1217  
  1218  ALTER TABLE ONLY public.users
  1219      ADD CONSTRAINT users_username_key UNIQUE (username);
  1220  
  1221  
  1222  --
  1223  -- Name: idx_audits_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1224  --
  1225  
  1226  CREATE INDEX idx_audits_user_id ON public.audits USING btree (userid);
  1227  
  1228  
  1229  --
  1230  -- Name: idx_channelmembers_channel_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1231  --
  1232  
  1233  CREATE INDEX idx_channelmembers_channel_id ON public.channelmembers USING btree (channelid);
  1234  
  1235  
  1236  --
  1237  -- Name: idx_channelmembers_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1238  --
  1239  
  1240  CREATE INDEX idx_channelmembers_user_id ON public.channelmembers USING btree (userid);
  1241  
  1242  
  1243  --
  1244  -- Name: idx_channels_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1245  --
  1246  
  1247  CREATE INDEX idx_channels_create_at ON public.channels USING btree (createat);
  1248  
  1249  
  1250  --
  1251  -- Name: idx_channels_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1252  --
  1253  
  1254  CREATE INDEX idx_channels_delete_at ON public.channels USING btree (deleteat);
  1255  
  1256  
  1257  --
  1258  -- Name: idx_channels_displayname_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1259  --
  1260  
  1261  CREATE INDEX idx_channels_displayname_lower ON public.channels USING btree (lower((displayname)::text));
  1262  
  1263  
  1264  --
  1265  -- Name: idx_channels_name; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1266  --
  1267  
  1268  CREATE INDEX idx_channels_name ON public.channels USING btree (name);
  1269  
  1270  
  1271  --
  1272  -- Name: idx_channels_name_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1273  --
  1274  
  1275  CREATE INDEX idx_channels_name_lower ON public.channels USING btree (lower((name)::text));
  1276  
  1277  
  1278  --
  1279  -- Name: idx_channels_team_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1280  --
  1281  
  1282  CREATE INDEX idx_channels_team_id ON public.channels USING btree (teamid);
  1283  
  1284  
  1285  --
  1286  -- Name: idx_channels_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1287  --
  1288  
  1289  CREATE INDEX idx_channels_txt ON public.channels USING gin (to_tsvector('english'::regconfig, (((name)::text || ' '::text) || (displayname)::text)));
  1290  
  1291  
  1292  --
  1293  -- Name: idx_channels_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1294  --
  1295  
  1296  CREATE INDEX idx_channels_update_at ON public.channels USING btree (updateat);
  1297  
  1298  
  1299  --
  1300  -- Name: idx_command_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1301  --
  1302  
  1303  CREATE INDEX idx_command_create_at ON public.commands USING btree (createat);
  1304  
  1305  
  1306  --
  1307  -- Name: idx_command_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1308  --
  1309  
  1310  CREATE INDEX idx_command_delete_at ON public.commands USING btree (deleteat);
  1311  
  1312  
  1313  --
  1314  -- Name: idx_command_team_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1315  --
  1316  
  1317  CREATE INDEX idx_command_team_id ON public.commands USING btree (teamid);
  1318  
  1319  
  1320  --
  1321  -- Name: idx_command_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1322  --
  1323  
  1324  CREATE INDEX idx_command_update_at ON public.commands USING btree (updateat);
  1325  
  1326  
  1327  --
  1328  -- Name: idx_command_webhook_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1329  --
  1330  
  1331  CREATE INDEX idx_command_webhook_create_at ON public.commandwebhooks USING btree (createat);
  1332  
  1333  
  1334  --
  1335  -- Name: idx_emoji_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1336  --
  1337  
  1338  CREATE INDEX idx_emoji_create_at ON public.emoji USING btree (createat);
  1339  
  1340  
  1341  --
  1342  -- Name: idx_emoji_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1343  --
  1344  
  1345  CREATE INDEX idx_emoji_delete_at ON public.emoji USING btree (deleteat);
  1346  
  1347  
  1348  --
  1349  -- Name: idx_emoji_name; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1350  --
  1351  
  1352  CREATE INDEX idx_emoji_name ON public.emoji USING btree (name);
  1353  
  1354  
  1355  --
  1356  -- Name: idx_emoji_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1357  --
  1358  
  1359  CREATE INDEX idx_emoji_update_at ON public.emoji USING btree (updateat);
  1360  
  1361  
  1362  --
  1363  -- Name: idx_fileinfo_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1364  --
  1365  
  1366  CREATE INDEX idx_fileinfo_create_at ON public.fileinfo USING btree (createat);
  1367  
  1368  
  1369  --
  1370  -- Name: idx_fileinfo_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1371  --
  1372  
  1373  CREATE INDEX idx_fileinfo_delete_at ON public.fileinfo USING btree (deleteat);
  1374  
  1375  
  1376  --
  1377  -- Name: idx_fileinfo_postid_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1378  --
  1379  
  1380  CREATE INDEX idx_fileinfo_postid_at ON public.fileinfo USING btree (postid);
  1381  
  1382  
  1383  --
  1384  -- Name: idx_fileinfo_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1385  --
  1386  
  1387  CREATE INDEX idx_fileinfo_update_at ON public.fileinfo USING btree (updateat);
  1388  
  1389  
  1390  --
  1391  -- Name: idx_incoming_webhook_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1392  --
  1393  
  1394  CREATE INDEX idx_incoming_webhook_create_at ON public.incomingwebhooks USING btree (createat);
  1395  
  1396  
  1397  --
  1398  -- Name: idx_incoming_webhook_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1399  --
  1400  
  1401  CREATE INDEX idx_incoming_webhook_delete_at ON public.incomingwebhooks USING btree (deleteat);
  1402  
  1403  
  1404  --
  1405  -- Name: idx_incoming_webhook_team_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1406  --
  1407  
  1408  CREATE INDEX idx_incoming_webhook_team_id ON public.incomingwebhooks USING btree (teamid);
  1409  
  1410  
  1411  --
  1412  -- Name: idx_incoming_webhook_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1413  --
  1414  
  1415  CREATE INDEX idx_incoming_webhook_update_at ON public.incomingwebhooks USING btree (updateat);
  1416  
  1417  
  1418  --
  1419  -- Name: idx_incoming_webhook_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1420  --
  1421  
  1422  CREATE INDEX idx_incoming_webhook_user_id ON public.incomingwebhooks USING btree (userid);
  1423  
  1424  
  1425  --
  1426  -- Name: idx_jobs_type; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1427  --
  1428  
  1429  CREATE INDEX idx_jobs_type ON public.jobs USING btree (type);
  1430  
  1431  
  1432  --
  1433  -- Name: idx_oauthaccessdata_client_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1434  --
  1435  
  1436  CREATE INDEX idx_oauthaccessdata_client_id ON public.oauthaccessdata USING btree (clientid);
  1437  
  1438  
  1439  --
  1440  -- Name: idx_oauthaccessdata_refresh_token; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1441  --
  1442  
  1443  CREATE INDEX idx_oauthaccessdata_refresh_token ON public.oauthaccessdata USING btree (refreshtoken);
  1444  
  1445  
  1446  --
  1447  -- Name: idx_oauthaccessdata_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1448  --
  1449  
  1450  CREATE INDEX idx_oauthaccessdata_user_id ON public.oauthaccessdata USING btree (userid);
  1451  
  1452  
  1453  --
  1454  -- Name: idx_oauthapps_creator_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1455  --
  1456  
  1457  CREATE INDEX idx_oauthapps_creator_id ON public.oauthapps USING btree (creatorid);
  1458  
  1459  
  1460  --
  1461  -- Name: idx_oauthauthdata_client_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1462  --
  1463  
  1464  CREATE INDEX idx_oauthauthdata_client_id ON public.oauthauthdata USING btree (code);
  1465  
  1466  
  1467  --
  1468  -- Name: idx_outgoing_webhook_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1469  --
  1470  
  1471  CREATE INDEX idx_outgoing_webhook_create_at ON public.outgoingwebhooks USING btree (createat);
  1472  
  1473  
  1474  --
  1475  -- Name: idx_outgoing_webhook_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1476  --
  1477  
  1478  CREATE INDEX idx_outgoing_webhook_delete_at ON public.outgoingwebhooks USING btree (deleteat);
  1479  
  1480  
  1481  --
  1482  -- Name: idx_outgoing_webhook_team_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1483  --
  1484  
  1485  CREATE INDEX idx_outgoing_webhook_team_id ON public.outgoingwebhooks USING btree (teamid);
  1486  
  1487  
  1488  --
  1489  -- Name: idx_outgoing_webhook_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1490  --
  1491  
  1492  CREATE INDEX idx_outgoing_webhook_update_at ON public.outgoingwebhooks USING btree (updateat);
  1493  
  1494  
  1495  --
  1496  -- Name: idx_posts_channel_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1497  --
  1498  
  1499  CREATE INDEX idx_posts_channel_id ON public.posts USING btree (channelid);
  1500  
  1501  
  1502  --
  1503  -- Name: idx_posts_channel_id_delete_at_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1504  --
  1505  
  1506  CREATE INDEX idx_posts_channel_id_delete_at_create_at ON public.posts USING btree (channelid, deleteat, createat);
  1507  
  1508  
  1509  --
  1510  -- Name: idx_posts_channel_id_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1511  --
  1512  
  1513  CREATE INDEX idx_posts_channel_id_update_at ON public.posts USING btree (channelid, updateat);
  1514  
  1515  
  1516  --
  1517  -- Name: idx_posts_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1518  --
  1519  
  1520  CREATE INDEX idx_posts_create_at ON public.posts USING btree (createat);
  1521  
  1522  
  1523  --
  1524  -- Name: idx_posts_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1525  --
  1526  
  1527  CREATE INDEX idx_posts_delete_at ON public.posts USING btree (deleteat);
  1528  
  1529  
  1530  --
  1531  -- Name: idx_posts_hashtags_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1532  --
  1533  
  1534  CREATE INDEX idx_posts_hashtags_txt ON public.posts USING gin (to_tsvector('english'::regconfig, (hashtags)::text));
  1535  
  1536  
  1537  --
  1538  -- Name: idx_posts_is_pinned; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1539  --
  1540  
  1541  CREATE INDEX idx_posts_is_pinned ON public.posts USING btree (ispinned);
  1542  
  1543  
  1544  --
  1545  -- Name: idx_posts_message_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1546  --
  1547  
  1548  CREATE INDEX idx_posts_message_txt ON public.posts USING gin (to_tsvector('english'::regconfig, (message)::text));
  1549  
  1550  
  1551  --
  1552  -- Name: idx_posts_root_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1553  --
  1554  
  1555  CREATE INDEX idx_posts_root_id ON public.posts USING btree (rootid);
  1556  
  1557  
  1558  --
  1559  -- Name: idx_posts_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1560  --
  1561  
  1562  CREATE INDEX idx_posts_update_at ON public.posts USING btree (updateat);
  1563  
  1564  
  1565  --
  1566  -- Name: idx_posts_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1567  --
  1568  
  1569  CREATE INDEX idx_posts_user_id ON public.posts USING btree (userid);
  1570  
  1571  
  1572  --
  1573  -- Name: idx_preferences_category; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1574  --
  1575  
  1576  CREATE INDEX idx_preferences_category ON public.preferences USING btree (category);
  1577  
  1578  
  1579  --
  1580  -- Name: idx_preferences_name; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1581  --
  1582  
  1583  CREATE INDEX idx_preferences_name ON public.preferences USING btree (name);
  1584  
  1585  
  1586  --
  1587  -- Name: idx_preferences_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1588  --
  1589  
  1590  CREATE INDEX idx_preferences_user_id ON public.preferences USING btree (userid);
  1591  
  1592  
  1593  --
  1594  -- Name: idx_sessions_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1595  --
  1596  
  1597  CREATE INDEX idx_sessions_create_at ON public.sessions USING btree (createat);
  1598  
  1599  
  1600  --
  1601  -- Name: idx_sessions_expires_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1602  --
  1603  
  1604  CREATE INDEX idx_sessions_expires_at ON public.sessions USING btree (expiresat);
  1605  
  1606  
  1607  --
  1608  -- Name: idx_sessions_last_activity_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1609  --
  1610  
  1611  CREATE INDEX idx_sessions_last_activity_at ON public.sessions USING btree (lastactivityat);
  1612  
  1613  
  1614  --
  1615  -- Name: idx_sessions_token; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1616  --
  1617  
  1618  CREATE INDEX idx_sessions_token ON public.sessions USING btree (token);
  1619  
  1620  
  1621  --
  1622  -- Name: idx_sessions_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1623  --
  1624  
  1625  CREATE INDEX idx_sessions_user_id ON public.sessions USING btree (userid);
  1626  
  1627  
  1628  --
  1629  -- Name: idx_status_status; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1630  --
  1631  
  1632  CREATE INDEX idx_status_status ON public.status USING btree (status);
  1633  
  1634  
  1635  --
  1636  -- Name: idx_status_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1637  --
  1638  
  1639  CREATE INDEX idx_status_user_id ON public.status USING btree (userid);
  1640  
  1641  
  1642  --
  1643  -- Name: idx_teammembers_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1644  --
  1645  
  1646  CREATE INDEX idx_teammembers_delete_at ON public.teammembers USING btree (deleteat);
  1647  
  1648  
  1649  --
  1650  -- Name: idx_teammembers_team_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1651  --
  1652  
  1653  CREATE INDEX idx_teammembers_team_id ON public.teammembers USING btree (teamid);
  1654  
  1655  
  1656  --
  1657  -- Name: idx_teammembers_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1658  --
  1659  
  1660  CREATE INDEX idx_teammembers_user_id ON public.teammembers USING btree (userid);
  1661  
  1662  
  1663  --
  1664  -- Name: idx_teams_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1665  --
  1666  
  1667  CREATE INDEX idx_teams_create_at ON public.teams USING btree (createat);
  1668  
  1669  
  1670  --
  1671  -- Name: idx_teams_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1672  --
  1673  
  1674  CREATE INDEX idx_teams_delete_at ON public.teams USING btree (deleteat);
  1675  
  1676  
  1677  --
  1678  -- Name: idx_teams_invite_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1679  --
  1680  
  1681  CREATE INDEX idx_teams_invite_id ON public.teams USING btree (inviteid);
  1682  
  1683  
  1684  --
  1685  -- Name: idx_teams_name; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1686  --
  1687  
  1688  CREATE INDEX idx_teams_name ON public.teams USING btree (name);
  1689  
  1690  
  1691  --
  1692  -- Name: idx_teams_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1693  --
  1694  
  1695  CREATE INDEX idx_teams_update_at ON public.teams USING btree (updateat);
  1696  
  1697  
  1698  --
  1699  -- Name: idx_user_access_tokens_token; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1700  --
  1701  
  1702  CREATE INDEX idx_user_access_tokens_token ON public.useraccesstokens USING btree (token);
  1703  
  1704  
  1705  --
  1706  -- Name: idx_user_access_tokens_user_id; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1707  --
  1708  
  1709  CREATE INDEX idx_user_access_tokens_user_id ON public.useraccesstokens USING btree (userid);
  1710  
  1711  
  1712  --
  1713  -- Name: idx_users_all_no_full_name_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1714  --
  1715  
  1716  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)));
  1717  
  1718  
  1719  --
  1720  -- Name: idx_users_all_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1721  --
  1722  
  1723  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)));
  1724  
  1725  
  1726  --
  1727  -- Name: idx_users_create_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1728  --
  1729  
  1730  CREATE INDEX idx_users_create_at ON public.users USING btree (createat);
  1731  
  1732  
  1733  --
  1734  -- Name: idx_users_delete_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1735  --
  1736  
  1737  CREATE INDEX idx_users_delete_at ON public.users USING btree (deleteat);
  1738  
  1739  
  1740  --
  1741  -- Name: idx_users_email; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1742  --
  1743  
  1744  CREATE INDEX idx_users_email ON public.users USING btree (email);
  1745  
  1746  
  1747  --
  1748  -- Name: idx_users_email_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1749  --
  1750  
  1751  CREATE INDEX idx_users_email_lower ON public.users USING btree (lower((email)::text));
  1752  
  1753  
  1754  --
  1755  -- Name: idx_users_firstname_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1756  --
  1757  
  1758  CREATE INDEX idx_users_firstname_lower ON public.users USING btree (lower((firstname)::text));
  1759  
  1760  
  1761  --
  1762  -- Name: idx_users_lastname_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1763  --
  1764  
  1765  CREATE INDEX idx_users_lastname_lower ON public.users USING btree (lower((lastname)::text));
  1766  
  1767  
  1768  --
  1769  -- Name: idx_users_names_no_full_name_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1770  --
  1771  
  1772  CREATE INDEX idx_users_names_no_full_name_txt ON public.users USING gin (to_tsvector('english'::regconfig, (((username)::text || ' '::text) || (nickname)::text)));
  1773  
  1774  
  1775  --
  1776  -- Name: idx_users_names_txt; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1777  --
  1778  
  1779  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)));
  1780  
  1781  
  1782  --
  1783  -- Name: idx_users_nickname_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1784  --
  1785  
  1786  CREATE INDEX idx_users_nickname_lower ON public.users USING btree (lower((nickname)::text));
  1787  
  1788  
  1789  --
  1790  -- Name: idx_users_update_at; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1791  --
  1792  
  1793  CREATE INDEX idx_users_update_at ON public.users USING btree (updateat);
  1794  
  1795  
  1796  --
  1797  -- Name: idx_users_username_lower; Type: INDEX; Schema: public; Owner: mmuser; Tablespace: 
  1798  --
  1799  
  1800  CREATE INDEX idx_users_username_lower ON public.users USING btree (lower((username)::text));
  1801  
  1802  
  1803  --
  1804  -- Name: SCHEMA public; Type: ACL; Schema: -; Owner: mmuser
  1805  --
  1806  
  1807  REVOKE ALL ON SCHEMA public FROM PUBLIC;
  1808  REVOKE ALL ON SCHEMA public FROM mmuser;
  1809  GRANT ALL ON SCHEMA public TO mmuser;
  1810  GRANT ALL ON SCHEMA public TO PUBLIC;
  1811  
  1812  
  1813  --
  1814  -- PostgreSQL database dump complete
  1815  --
  1816