1-- MariaDB dump 10.19  Distrib 10.5.10-MariaDB, for Linux (x86_64)
2--
3-- Host: 127.0.0.1    Database: mattermost_test
4-- ------------------------------------------------------
5-- Server version	5.7.12
6/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
7/*!40103 SET TIME_ZONE='+00:00' */;
8/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
9/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
10/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
11/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
12
13--
14-- Table structure for table `Audits`
15--
16
17/*!40101 SET @saved_cs_client     = @@character_set_client */;
18/*!40101 SET character_set_client = utf8 */;
19CREATE TABLE `Audits` (
20  `Id` varchar(26) NOT NULL,
21  `CreateAt` bigint(20) DEFAULT NULL,
22  `UserId` varchar(26) DEFAULT NULL,
23  `Action` text,
24  `ExtraInfo` text,
25  `IpAddress` varchar(64) DEFAULT NULL,
26  `SessionId` varchar(26) DEFAULT NULL,
27  PRIMARY KEY (`Id`),
28  KEY `idx_audits_user_id` (`UserId`)
29);
30/*!40101 SET character_set_client = @saved_cs_client */;
31
32--
33-- Table structure for table `Bots`
34--
35
36/*!40101 SET @saved_cs_client     = @@character_set_client */;
37/*!40101 SET character_set_client = utf8 */;
38CREATE TABLE `Bots` (
39  `UserId` varchar(26) NOT NULL,
40  `Description` text,
41  `OwnerId` varchar(190) DEFAULT NULL,
42  `LastIconUpdate` bigint(20) DEFAULT NULL,
43  `CreateAt` bigint(20) DEFAULT NULL,
44  `UpdateAt` bigint(20) DEFAULT NULL,
45  `DeleteAt` bigint(20) DEFAULT NULL,
46  PRIMARY KEY (`UserId`)
47);
48/*!40101 SET character_set_client = @saved_cs_client */;
49
50--
51-- Table structure for table `ChannelMemberHistory`
52--
53
54/*!40101 SET @saved_cs_client     = @@character_set_client */;
55/*!40101 SET character_set_client = utf8 */;
56CREATE TABLE `ChannelMemberHistory` (
57  `ChannelId` varchar(26) NOT NULL,
58  `UserId` varchar(26) NOT NULL,
59  `JoinTime` bigint(20) NOT NULL,
60  `LeaveTime` bigint(20) DEFAULT NULL,
61  PRIMARY KEY (`ChannelId`,`UserId`,`JoinTime`)
62);
63/*!40101 SET character_set_client = @saved_cs_client */;
64
65--
66-- Table structure for table `ChannelMembers`
67--
68
69/*!40101 SET @saved_cs_client     = @@character_set_client */;
70/*!40101 SET character_set_client = utf8 */;
71CREATE TABLE `ChannelMembers` (
72  `ChannelId` varchar(26) NOT NULL,
73  `UserId` varchar(26) NOT NULL,
74  `Roles` varchar(64) DEFAULT NULL,
75  `LastViewedAt` bigint(20) DEFAULT NULL,
76  `MsgCount` bigint(20) DEFAULT NULL,
77  `MentionCount` bigint(20) DEFAULT NULL,
78  `NotifyProps` json DEFAULT NULL,
79  `LastUpdateAt` bigint(20) DEFAULT NULL,
80  `SchemeUser` tinyint(4) DEFAULT NULL,
81  `SchemeAdmin` tinyint(4) DEFAULT NULL,
82  `SchemeGuest` tinyint(4) DEFAULT NULL,
83  `MentionCountRoot` bigint(20) DEFAULT NULL,
84  `MsgCountRoot` bigint(20) DEFAULT NULL,
85  PRIMARY KEY (`ChannelId`,`UserId`),
86  KEY `idx_channelmembers_user_id_channel_id_last_viewed_at` (`UserId`,`ChannelId`,`LastViewedAt`),
87  KEY `idx_channelmembers_channel_id_scheme_guest_user_id` (`ChannelId`,`SchemeGuest`,`UserId`)
88);
89/*!40101 SET character_set_client = @saved_cs_client */;
90
91--
92-- Table structure for table `Channels`
93--
94
95/*!40101 SET @saved_cs_client     = @@character_set_client */;
96/*!40101 SET character_set_client = utf8 */;
97CREATE TABLE `Channels` (
98  `Id` varchar(26) NOT NULL,
99  `CreateAt` bigint(20) DEFAULT NULL,
100  `UpdateAt` bigint(20) DEFAULT NULL,
101  `DeleteAt` bigint(20) DEFAULT NULL,
102  `TeamId` varchar(26) DEFAULT NULL,
103  `Type` varchar(1) DEFAULT NULL,
104  `DisplayName` varchar(64) DEFAULT NULL,
105  `Name` varchar(64) DEFAULT NULL,
106  `Header` text,
107  `Purpose` varchar(250) DEFAULT NULL,
108  `LastPostAt` bigint(20) DEFAULT NULL,
109  `TotalMsgCount` bigint(20) DEFAULT NULL,
110  `ExtraUpdateAt` bigint(20) DEFAULT NULL,
111  `CreatorId` varchar(26) DEFAULT NULL,
112  `SchemeId` varchar(26) DEFAULT NULL,
113  `GroupConstrained` tinyint(1) DEFAULT NULL,
114  `Shared` tinyint(1) DEFAULT NULL,
115  `TotalMsgCountRoot` bigint(20) DEFAULT NULL,
116  PRIMARY KEY (`Id`),
117  UNIQUE KEY `Name` (`Name`,`TeamId`),
118  KEY `idx_channels_update_at` (`UpdateAt`),
119  KEY `idx_channels_create_at` (`CreateAt`),
120  KEY `idx_channels_delete_at` (`DeleteAt`),
121  KEY `idx_channels_scheme_id` (`SchemeId`),
122  KEY `idx_channels_team_id_display_name` (`TeamId`,`DisplayName`),
123  KEY `idx_channels_team_id_type` (`TeamId`,`Type`),
124  FULLTEXT KEY `idx_channel_search_txt` (`Name`,`DisplayName`,`Purpose`)
125);
126/*!40101 SET character_set_client = @saved_cs_client */;
127
128--
129-- Table structure for table `ClusterDiscovery`
130--
131
132/*!40101 SET @saved_cs_client     = @@character_set_client */;
133/*!40101 SET character_set_client = utf8 */;
134CREATE TABLE `ClusterDiscovery` (
135  `Id` varchar(26) NOT NULL,
136  `Type` varchar(64) DEFAULT NULL,
137  `ClusterName` varchar(64) DEFAULT NULL,
138  `Hostname` text,
139  `GossipPort` int(11) DEFAULT NULL,
140  `Port` int(11) DEFAULT NULL,
141  `CreateAt` bigint(20) DEFAULT NULL,
142  `LastPingAt` bigint(20) DEFAULT NULL,
143  PRIMARY KEY (`Id`)
144);
145/*!40101 SET character_set_client = @saved_cs_client */;
146
147--
148-- Table structure for table `CommandWebhooks`
149--
150
151/*!40101 SET @saved_cs_client     = @@character_set_client */;
152/*!40101 SET character_set_client = utf8 */;
153CREATE TABLE `CommandWebhooks` (
154  `Id` varchar(26) NOT NULL,
155  `CreateAt` bigint(20) DEFAULT NULL,
156  `CommandId` varchar(26) DEFAULT NULL,
157  `UserId` varchar(26) DEFAULT NULL,
158  `ChannelId` varchar(26) DEFAULT NULL,
159  `RootId` varchar(26) DEFAULT NULL,
160  `UseCount` int(11) DEFAULT NULL,
161  PRIMARY KEY (`Id`),
162  KEY `idx_command_webhook_create_at` (`CreateAt`)
163);
164/*!40101 SET character_set_client = @saved_cs_client */;
165
166--
167-- Table structure for table `Commands`
168--
169
170/*!40101 SET @saved_cs_client     = @@character_set_client */;
171/*!40101 SET character_set_client = utf8 */;
172CREATE TABLE `Commands` (
173  `Id` varchar(26) NOT NULL,
174  `Token` varchar(26) DEFAULT NULL,
175  `CreateAt` bigint(20) DEFAULT NULL,
176  `UpdateAt` bigint(20) DEFAULT NULL,
177  `DeleteAt` bigint(20) DEFAULT NULL,
178  `CreatorId` varchar(26) DEFAULT NULL,
179  `TeamId` varchar(26) DEFAULT NULL,
180  `Trigger` varchar(128) DEFAULT NULL,
181  `Method` varchar(1) DEFAULT NULL,
182  `Username` varchar(64) DEFAULT NULL,
183  `IconURL` text,
184  `AutoComplete` tinyint(1) DEFAULT NULL,
185  `AutoCompleteDesc` text,
186  `AutoCompleteHint` text,
187  `DisplayName` varchar(64) DEFAULT NULL,
188  `Description` varchar(128) DEFAULT NULL,
189  `URL` text,
190  `PluginId` varchar(190) DEFAULT NULL,
191  PRIMARY KEY (`Id`),
192  KEY `idx_command_team_id` (`TeamId`),
193  KEY `idx_command_update_at` (`UpdateAt`),
194  KEY `idx_command_create_at` (`CreateAt`),
195  KEY `idx_command_delete_at` (`DeleteAt`)
196);
197/*!40101 SET character_set_client = @saved_cs_client */;
198
199--
200-- Table structure for table `Compliances`
201--
202
203/*!40101 SET @saved_cs_client     = @@character_set_client */;
204/*!40101 SET character_set_client = utf8 */;
205CREATE TABLE `Compliances` (
206  `Id` varchar(26) NOT NULL,
207  `CreateAt` bigint(20) DEFAULT NULL,
208  `UserId` varchar(26) DEFAULT NULL,
209  `Status` varchar(64) DEFAULT NULL,
210  `Count` int(11) DEFAULT NULL,
211  `Desc` text,
212  `Type` varchar(64) DEFAULT NULL,
213  `StartAt` bigint(20) DEFAULT NULL,
214  `EndAt` bigint(20) DEFAULT NULL,
215  `Keywords` text,
216  `Emails` text,
217  PRIMARY KEY (`Id`)
218);
219/*!40101 SET character_set_client = @saved_cs_client */;
220
221--
222-- Table structure for table `Emoji`
223--
224
225/*!40101 SET @saved_cs_client     = @@character_set_client */;
226/*!40101 SET character_set_client = utf8 */;
227CREATE TABLE `Emoji` (
228  `Id` varchar(26) NOT NULL,
229  `CreateAt` bigint(20) DEFAULT NULL,
230  `UpdateAt` bigint(20) DEFAULT NULL,
231  `DeleteAt` bigint(20) DEFAULT NULL,
232  `CreatorId` varchar(26) DEFAULT NULL,
233  `Name` varchar(64) DEFAULT NULL,
234  PRIMARY KEY (`Id`),
235  UNIQUE KEY `Name` (`Name`,`DeleteAt`),
236  KEY `idx_emoji_update_at` (`UpdateAt`),
237  KEY `idx_emoji_create_at` (`CreateAt`),
238  KEY `idx_emoji_delete_at` (`DeleteAt`)
239);
240/*!40101 SET character_set_client = @saved_cs_client */;
241
242--
243-- Table structure for table `FileInfo`
244--
245
246/*!40101 SET @saved_cs_client     = @@character_set_client */;
247/*!40101 SET character_set_client = utf8 */;
248CREATE TABLE `FileInfo` (
249  `Id` varchar(26) NOT NULL,
250  `CreatorId` varchar(26) DEFAULT NULL,
251  `PostId` varchar(26) DEFAULT NULL,
252  `CreateAt` bigint(20) DEFAULT NULL,
253  `UpdateAt` bigint(20) DEFAULT NULL,
254  `DeleteAt` bigint(20) DEFAULT NULL,
255  `Path` text,
256  `ThumbnailPath` text,
257  `PreviewPath` text,
258  `Name` text,
259  `Extension` varchar(64) DEFAULT NULL,
260  `Size` bigint(20) DEFAULT NULL,
261  `MimeType` text,
262  `Width` int(11) DEFAULT NULL,
263  `Height` int(11) DEFAULT NULL,
264  `HasPreviewImage` tinyint(1) DEFAULT NULL,
265  `MiniPreview` mediumblob,
266  `Content` longtext,
267  `RemoteId` varchar(26) DEFAULT NULL,
268  PRIMARY KEY (`Id`),
269  KEY `idx_fileinfo_update_at` (`UpdateAt`),
270  KEY `idx_fileinfo_create_at` (`CreateAt`),
271  KEY `idx_fileinfo_delete_at` (`DeleteAt`),
272  KEY `idx_fileinfo_postid_at` (`PostId`),
273  KEY `idx_fileinfo_extension_at` (`Extension`),
274  FULLTEXT KEY `idx_fileinfo_name_txt` (`Name`),
275  FULLTEXT KEY `idx_fileinfo_content_txt` (`Content`)
276);
277/*!40101 SET character_set_client = @saved_cs_client */;
278
279--
280-- Table structure for table `GroupChannels`
281--
282
283/*!40101 SET @saved_cs_client     = @@character_set_client */;
284/*!40101 SET character_set_client = utf8 */;
285CREATE TABLE `GroupChannels` (
286  `GroupId` varchar(26) NOT NULL,
287  `AutoAdd` tinyint(1) DEFAULT NULL,
288  `SchemeAdmin` tinyint(1) DEFAULT NULL,
289  `CreateAt` bigint(20) DEFAULT NULL,
290  `DeleteAt` bigint(20) DEFAULT NULL,
291  `UpdateAt` bigint(20) DEFAULT NULL,
292  `ChannelId` varchar(26) NOT NULL,
293  PRIMARY KEY (`GroupId`,`ChannelId`),
294  KEY `idx_groupchannels_channelid` (`ChannelId`),
295  KEY `idx_groupchannels_schemeadmin` (`SchemeAdmin`)
296);
297/*!40101 SET character_set_client = @saved_cs_client */;
298
299--
300-- Table structure for table `GroupMembers`
301--
302
303/*!40101 SET @saved_cs_client     = @@character_set_client */;
304/*!40101 SET character_set_client = utf8 */;
305CREATE TABLE `GroupMembers` (
306  `GroupId` varchar(26) NOT NULL,
307  `UserId` varchar(26) NOT NULL,
308  `CreateAt` bigint(20) DEFAULT NULL,
309  `DeleteAt` bigint(20) DEFAULT NULL,
310  PRIMARY KEY (`GroupId`,`UserId`),
311  KEY `idx_groupmembers_create_at` (`CreateAt`)
312);
313/*!40101 SET character_set_client = @saved_cs_client */;
314
315--
316-- Table structure for table `GroupTeams`
317--
318
319/*!40101 SET @saved_cs_client     = @@character_set_client */;
320/*!40101 SET character_set_client = utf8 */;
321CREATE TABLE `GroupTeams` (
322  `GroupId` varchar(26) NOT NULL,
323  `AutoAdd` tinyint(1) DEFAULT NULL,
324  `SchemeAdmin` tinyint(1) DEFAULT NULL,
325  `CreateAt` bigint(20) DEFAULT NULL,
326  `DeleteAt` bigint(20) DEFAULT NULL,
327  `UpdateAt` bigint(20) DEFAULT NULL,
328  `TeamId` varchar(26) NOT NULL,
329  PRIMARY KEY (`GroupId`,`TeamId`),
330  KEY `idx_groupteams_teamid` (`TeamId`),
331  KEY `idx_groupteams_schemeadmin` (`SchemeAdmin`)
332);
333/*!40101 SET character_set_client = @saved_cs_client */;
334
335--
336-- Table structure for table `IncomingWebhooks`
337--
338
339/*!40101 SET @saved_cs_client     = @@character_set_client */;
340/*!40101 SET character_set_client = utf8 */;
341CREATE TABLE `IncomingWebhooks` (
342  `Id` varchar(26) NOT NULL,
343  `CreateAt` bigint(20) DEFAULT NULL,
344  `UpdateAt` bigint(20) DEFAULT NULL,
345  `DeleteAt` bigint(20) DEFAULT NULL,
346  `UserId` varchar(26) DEFAULT NULL,
347  `ChannelId` varchar(26) DEFAULT NULL,
348  `TeamId` varchar(26) DEFAULT NULL,
349  `DisplayName` varchar(64) DEFAULT NULL,
350  `Description` text,
351  `Username` varchar(255) DEFAULT NULL,
352  `IconURL` text,
353  `ChannelLocked` tinyint(1) DEFAULT NULL,
354  PRIMARY KEY (`Id`),
355  KEY `idx_incoming_webhook_user_id` (`UserId`),
356  KEY `idx_incoming_webhook_team_id` (`TeamId`),
357  KEY `idx_incoming_webhook_update_at` (`UpdateAt`),
358  KEY `idx_incoming_webhook_create_at` (`CreateAt`),
359  KEY `idx_incoming_webhook_delete_at` (`DeleteAt`)
360);
361/*!40101 SET character_set_client = @saved_cs_client */;
362
363--
364-- Table structure for table `Jobs`
365--
366
367/*!40101 SET @saved_cs_client     = @@character_set_client */;
368/*!40101 SET character_set_client = utf8 */;
369CREATE TABLE `Jobs` (
370  `Id` varchar(26) NOT NULL,
371  `Type` varchar(32) DEFAULT NULL,
372  `Priority` bigint(20) DEFAULT NULL,
373  `CreateAt` bigint(20) DEFAULT NULL,
374  `StartAt` bigint(20) DEFAULT NULL,
375  `LastActivityAt` bigint(20) DEFAULT NULL,
376  `Status` varchar(32) DEFAULT NULL,
377  `Progress` bigint(20) DEFAULT NULL,
378  `Data` json DEFAULT NULL,
379  PRIMARY KEY (`Id`),
380  KEY `idx_jobs_type` (`Type`)
381);
382/*!40101 SET character_set_client = @saved_cs_client */;
383
384--
385-- Table structure for table `Licenses`
386--
387
388/*!40101 SET @saved_cs_client     = @@character_set_client */;
389/*!40101 SET character_set_client = utf8 */;
390CREATE TABLE `Licenses` (
391  `Id` varchar(26) NOT NULL,
392  `CreateAt` bigint(20) DEFAULT NULL,
393  `Bytes` text,
394  PRIMARY KEY (`Id`)
395);
396/*!40101 SET character_set_client = @saved_cs_client */;
397
398--
399-- Table structure for table `LinkMetadata`
400--
401
402/*!40101 SET @saved_cs_client     = @@character_set_client */;
403/*!40101 SET character_set_client = utf8 */;
404CREATE TABLE `LinkMetadata` (
405  `Hash` bigint(20) NOT NULL,
406  `URL` text,
407  `Timestamp` bigint(20) DEFAULT NULL,
408  `Type` varchar(16) DEFAULT NULL,
409  `Data` json DEFAULT NULL,
410  PRIMARY KEY (`Hash`),
411  KEY `idx_link_metadata_url_timestamp` (`URL`(512),`Timestamp`)
412);
413/*!40101 SET character_set_client = @saved_cs_client */;
414
415--
416-- Table structure for table `OAuthAccessData`
417--
418
419/*!40101 SET @saved_cs_client     = @@character_set_client */;
420/*!40101 SET character_set_client = utf8 */;
421CREATE TABLE `OAuthAccessData` (
422  `ClientId` varchar(26) DEFAULT NULL,
423  `UserId` varchar(26) DEFAULT NULL,
424  `Token` varchar(26) NOT NULL,
425  `RefreshToken` varchar(26) DEFAULT NULL,
426  `RedirectUri` text,
427  `ExpiresAt` bigint(20) DEFAULT NULL,
428  `Scope` varchar(128) DEFAULT NULL,
429  PRIMARY KEY (`Token`),
430  UNIQUE KEY `ClientId` (`ClientId`,`UserId`),
431  KEY `idx_oauthaccessdata_user_id` (`UserId`),
432  KEY `idx_oauthaccessdata_refresh_token` (`RefreshToken`)
433);
434/*!40101 SET character_set_client = @saved_cs_client */;
435
436--
437-- Table structure for table `OAuthApps`
438--
439
440/*!40101 SET @saved_cs_client     = @@character_set_client */;
441/*!40101 SET character_set_client = utf8 */;
442CREATE TABLE `OAuthApps` (
443  `Id` varchar(26) NOT NULL,
444  `CreatorId` varchar(26) DEFAULT NULL,
445  `CreateAt` bigint(20) DEFAULT NULL,
446  `UpdateAt` bigint(20) DEFAULT NULL,
447  `ClientSecret` varchar(128) DEFAULT NULL,
448  `Name` varchar(64) DEFAULT NULL,
449  `Description` text,
450  `IconURL` text,
451  `CallbackUrls` text,
452  `Homepage` text,
453  `IsTrusted` tinyint(1) DEFAULT NULL,
454  PRIMARY KEY (`Id`),
455  KEY `idx_oauthapps_creator_id` (`CreatorId`)
456);
457/*!40101 SET character_set_client = @saved_cs_client */;
458
459--
460-- Table structure for table `OAuthAuthData`
461--
462
463/*!40101 SET @saved_cs_client     = @@character_set_client */;
464/*!40101 SET character_set_client = utf8 */;
465CREATE TABLE `OAuthAuthData` (
466  `ClientId` varchar(26) DEFAULT NULL,
467  `UserId` varchar(26) DEFAULT NULL,
468  `Code` varchar(128) NOT NULL,
469  `ExpiresIn` int(11) DEFAULT NULL,
470  `CreateAt` bigint(20) DEFAULT NULL,
471  `RedirectUri` text,
472  `State` text,
473  `Scope` varchar(128) DEFAULT NULL,
474  PRIMARY KEY (`Code`)
475);
476/*!40101 SET character_set_client = @saved_cs_client */;
477
478--
479-- Table structure for table `OutgoingWebhooks`
480--
481
482/*!40101 SET @saved_cs_client     = @@character_set_client */;
483/*!40101 SET character_set_client = utf8 */;
484CREATE TABLE `OutgoingWebhooks` (
485  `Id` varchar(26) NOT NULL,
486  `Token` varchar(26) DEFAULT NULL,
487  `CreateAt` bigint(20) DEFAULT NULL,
488  `UpdateAt` bigint(20) DEFAULT NULL,
489  `DeleteAt` bigint(20) DEFAULT NULL,
490  `CreatorId` varchar(26) DEFAULT NULL,
491  `ChannelId` varchar(26) DEFAULT NULL,
492  `TeamId` varchar(26) DEFAULT NULL,
493  `TriggerWords` text,
494  `TriggerWhen` int(11) DEFAULT NULL,
495  `CallbackURLs` text,
496  `DisplayName` varchar(64) DEFAULT NULL,
497  `Description` text,
498  `ContentType` varchar(128) DEFAULT NULL,
499  `Username` varchar(64) DEFAULT NULL,
500  `IconURL` text,
501  PRIMARY KEY (`Id`),
502  KEY `idx_outgoing_webhook_team_id` (`TeamId`),
503  KEY `idx_outgoing_webhook_update_at` (`UpdateAt`),
504  KEY `idx_outgoing_webhook_create_at` (`CreateAt`),
505  KEY `idx_outgoing_webhook_delete_at` (`DeleteAt`)
506);
507/*!40101 SET character_set_client = @saved_cs_client */;
508
509--
510-- Table structure for table `PluginKeyValueStore`
511--
512
513/*!40101 SET @saved_cs_client     = @@character_set_client */;
514/*!40101 SET character_set_client = utf8 */;
515CREATE TABLE `PluginKeyValueStore` (
516  `PluginId` varchar(190) NOT NULL,
517  `PKey` varchar(50) NOT NULL,
518  `PValue` mediumblob,
519  `ExpireAt` bigint(20) DEFAULT NULL,
520  PRIMARY KEY (`PluginId`,`PKey`)
521);
522/*!40101 SET character_set_client = @saved_cs_client */;
523
524--
525-- Table structure for table `Posts`
526--
527
528/*!40101 SET @saved_cs_client     = @@character_set_client */;
529/*!40101 SET character_set_client = utf8 */;
530CREATE TABLE `Posts` (
531  `Id` varchar(26) NOT NULL,
532  `CreateAt` bigint(20) DEFAULT NULL,
533  `UpdateAt` bigint(20) DEFAULT NULL,
534  `EditAt` bigint(20) DEFAULT NULL,
535  `DeleteAt` bigint(20) DEFAULT NULL,
536  `IsPinned` tinyint(1) DEFAULT NULL,
537  `UserId` varchar(26) DEFAULT NULL,
538  `ChannelId` varchar(26) DEFAULT NULL,
539  `RootId` varchar(26) DEFAULT NULL,
540  `OriginalId` varchar(26) DEFAULT NULL,
541  `Message` text,
542  `Type` varchar(26) DEFAULT NULL,
543  `Props` json DEFAULT NULL,
544  `Hashtags` text,
545  `Filenames` text,
546  `FileIds` text,
547  `HasReactions` tinyint(1) DEFAULT NULL,
548  `RemoteId` varchar(26) DEFAULT NULL,
549  PRIMARY KEY (`Id`),
550  KEY `idx_posts_update_at` (`UpdateAt`),
551  KEY `idx_posts_create_at` (`CreateAt`),
552  KEY `idx_posts_delete_at` (`DeleteAt`),
553  KEY `idx_posts_user_id` (`UserId`),
554  KEY `idx_posts_is_pinned` (`IsPinned`),
555  KEY `idx_posts_channel_id_update_at` (`ChannelId`,`UpdateAt`),
556  KEY `idx_posts_channel_id_delete_at_create_at` (`ChannelId`,`DeleteAt`,`CreateAt`),
557  KEY `idx_posts_root_id_delete_at` (`RootId`,`DeleteAt`),
558  FULLTEXT KEY `idx_posts_message_txt` (`Message`),
559  FULLTEXT KEY `idx_posts_hashtags_txt` (`Hashtags`)
560);
561/*!40101 SET character_set_client = @saved_cs_client */;
562
563--
564-- Table structure for table `Preferences`
565--
566
567/*!40101 SET @saved_cs_client     = @@character_set_client */;
568/*!40101 SET character_set_client = utf8 */;
569CREATE TABLE `Preferences` (
570  `UserId` varchar(26) NOT NULL,
571  `Category` varchar(32) NOT NULL,
572  `Name` varchar(32) NOT NULL,
573  `Value` text,
574  PRIMARY KEY (`UserId`,`Category`,`Name`),
575  KEY `idx_preferences_category` (`Category`),
576  KEY `idx_preferences_name` (`Name`)
577);
578/*!40101 SET character_set_client = @saved_cs_client */;
579
580--
581-- Table structure for table `ProductNoticeViewState`
582--
583
584/*!40101 SET @saved_cs_client     = @@character_set_client */;
585/*!40101 SET character_set_client = utf8 */;
586CREATE TABLE `ProductNoticeViewState` (
587  `UserId` varchar(26) NOT NULL,
588  `NoticeId` varchar(26) NOT NULL,
589  `Viewed` int(11) DEFAULT NULL,
590  `Timestamp` bigint(20) DEFAULT NULL,
591  PRIMARY KEY (`UserId`,`NoticeId`),
592  KEY `idx_notice_views_timestamp` (`Timestamp`),
593  KEY `idx_notice_views_notice_id` (`NoticeId`)
594);
595/*!40101 SET character_set_client = @saved_cs_client */;
596
597--
598-- Table structure for table `PublicChannels`
599--
600
601/*!40101 SET @saved_cs_client     = @@character_set_client */;
602/*!40101 SET character_set_client = utf8 */;
603CREATE TABLE `PublicChannels` (
604  `Id` varchar(26) NOT NULL,
605  `DeleteAt` bigint(20) DEFAULT NULL,
606  `TeamId` varchar(26) DEFAULT NULL,
607  `DisplayName` varchar(64) DEFAULT NULL,
608  `Name` varchar(64) DEFAULT NULL,
609  `Header` text,
610  `Purpose` varchar(250) DEFAULT NULL,
611  PRIMARY KEY (`Id`),
612  UNIQUE KEY `Name` (`Name`,`TeamId`),
613  KEY `idx_publicchannels_team_id` (`TeamId`),
614  KEY `idx_publicchannels_delete_at` (`DeleteAt`),
615  FULLTEXT KEY `idx_publicchannels_search_txt` (`Name`,`DisplayName`,`Purpose`)
616);
617/*!40101 SET character_set_client = @saved_cs_client */;
618
619--
620-- Table structure for table `Reactions`
621--
622
623/*!40101 SET @saved_cs_client     = @@character_set_client */;
624/*!40101 SET character_set_client = utf8 */;
625CREATE TABLE `Reactions` (
626  `UserId` varchar(26) NOT NULL,
627  `PostId` varchar(26) NOT NULL,
628  `EmojiName` varchar(64) NOT NULL,
629  `CreateAt` bigint(20) DEFAULT NULL,
630  `UpdateAt` bigint(20) DEFAULT NULL,
631  `DeleteAt` bigint(20) DEFAULT NULL,
632  `RemoteId` varchar(26) DEFAULT NULL,
633  PRIMARY KEY (`PostId`,`UserId`,`EmojiName`)
634);
635/*!40101 SET character_set_client = @saved_cs_client */;
636
637--
638-- Table structure for table `RemoteClusters`
639--
640
641/*!40101 SET @saved_cs_client     = @@character_set_client */;
642/*!40101 SET character_set_client = utf8 */;
643CREATE TABLE `RemoteClusters` (
644  `RemoteId` varchar(26) NOT NULL,
645  `RemoteTeamId` varchar(26) DEFAULT NULL,
646  `Name` varchar(64) NOT NULL,
647  `DisplayName` varchar(64) DEFAULT NULL,
648  `SiteURL` text,
649  `CreateAt` bigint(20) DEFAULT NULL,
650  `LastPingAt` bigint(20) DEFAULT NULL,
651  `Token` varchar(26) DEFAULT NULL,
652  `RemoteToken` varchar(26) DEFAULT NULL,
653  `Topics` text,
654  `CreatorId` varchar(26) DEFAULT NULL,
655  PRIMARY KEY (`RemoteId`,`Name`),
656  UNIQUE KEY `remote_clusters_site_url_unique` (`RemoteTeamId`,`SiteURL`(168))
657);
658/*!40101 SET character_set_client = @saved_cs_client */;
659
660--
661-- Table structure for table `RetentionPolicies`
662--
663
664/*!40101 SET @saved_cs_client     = @@character_set_client */;
665/*!40101 SET character_set_client = utf8 */;
666CREATE TABLE `RetentionPolicies` (
667  `Id` varchar(26) NOT NULL,
668  `DisplayName` varchar(64) DEFAULT NULL,
669  `PostDuration` bigint(20) DEFAULT NULL,
670  PRIMARY KEY (`Id`),
671  KEY `IDX_RetentionPolicies_DisplayName` (`DisplayName`)
672);
673/*!40101 SET character_set_client = @saved_cs_client */;
674
675--
676-- Table structure for table `RetentionPoliciesChannels`
677--
678
679/*!40101 SET @saved_cs_client     = @@character_set_client */;
680/*!40101 SET character_set_client = utf8 */;
681CREATE TABLE `RetentionPoliciesChannels` (
682  `PolicyId` varchar(26) DEFAULT NULL,
683  `ChannelId` varchar(26) NOT NULL,
684  PRIMARY KEY (`ChannelId`),
685  KEY `IDX_RetentionPoliciesChannels_PolicyId` (`PolicyId`),
686  CONSTRAINT `FK_RetentionPoliciesChannels_RetentionPolicies` FOREIGN KEY (`PolicyId`) REFERENCES `RetentionPolicies` (`Id`) ON DELETE CASCADE
687);
688/*!40101 SET character_set_client = @saved_cs_client */;
689
690--
691-- Table structure for table `RetentionPoliciesTeams`
692--
693
694/*!40101 SET @saved_cs_client     = @@character_set_client */;
695/*!40101 SET character_set_client = utf8 */;
696CREATE TABLE `RetentionPoliciesTeams` (
697  `PolicyId` varchar(26) DEFAULT NULL,
698  `TeamId` varchar(26) NOT NULL,
699  PRIMARY KEY (`TeamId`),
700  KEY `IDX_RetentionPoliciesTeams_PolicyId` (`PolicyId`),
701  CONSTRAINT `FK_RetentionPoliciesTeams_RetentionPolicies` FOREIGN KEY (`PolicyId`) REFERENCES `RetentionPolicies` (`Id`) ON DELETE CASCADE
702);
703/*!40101 SET character_set_client = @saved_cs_client */;
704
705--
706-- Table structure for table `Roles`
707--
708
709/*!40101 SET @saved_cs_client     = @@character_set_client */;
710/*!40101 SET character_set_client = utf8 */;
711CREATE TABLE `Roles` (
712  `Id` varchar(26) NOT NULL,
713  `Name` varchar(64) DEFAULT NULL,
714  `DisplayName` varchar(128) DEFAULT NULL,
715  `Description` text,
716  `CreateAt` bigint(20) DEFAULT NULL,
717  `UpdateAt` bigint(20) DEFAULT NULL,
718  `DeleteAt` bigint(20) DEFAULT NULL,
719  `Permissions` longtext,
720  `SchemeManaged` tinyint(1) DEFAULT NULL,
721  `BuiltIn` tinyint(1) DEFAULT NULL,
722  PRIMARY KEY (`Id`),
723  UNIQUE KEY `Name` (`Name`)
724);
725/*!40101 SET character_set_client = @saved_cs_client */;
726
727--
728-- Table structure for table `Schemes`
729--
730
731/*!40101 SET @saved_cs_client     = @@character_set_client */;
732/*!40101 SET character_set_client = utf8 */;
733CREATE TABLE `Schemes` (
734  `Id` varchar(26) NOT NULL,
735  `Name` varchar(64) DEFAULT NULL,
736  `DisplayName` varchar(128) DEFAULT NULL,
737  `Description` text,
738  `CreateAt` bigint(20) DEFAULT NULL,
739  `UpdateAt` bigint(20) DEFAULT NULL,
740  `DeleteAt` bigint(20) DEFAULT NULL,
741  `Scope` varchar(32) DEFAULT NULL,
742  `DefaultTeamAdminRole` varchar(64) DEFAULT NULL,
743  `DefaultTeamUserRole` varchar(64) DEFAULT NULL,
744  `DefaultChannelAdminRole` varchar(64) DEFAULT NULL,
745  `DefaultChannelUserRole` varchar(64) DEFAULT NULL,
746  `DefaultTeamGuestRole` varchar(64) DEFAULT NULL,
747  `DefaultChannelGuestRole` varchar(64) DEFAULT NULL,
748  PRIMARY KEY (`Id`),
749  UNIQUE KEY `Name` (`Name`),
750  KEY `idx_schemes_channel_guest_role` (`DefaultChannelGuestRole`),
751  KEY `idx_schemes_channel_user_role` (`DefaultChannelUserRole`),
752  KEY `idx_schemes_channel_admin_role` (`DefaultChannelAdminRole`)
753);
754/*!40101 SET character_set_client = @saved_cs_client */;
755
756--
757-- Table structure for table `Sessions`
758--
759
760/*!40101 SET @saved_cs_client     = @@character_set_client */;
761/*!40101 SET character_set_client = utf8 */;
762CREATE TABLE `Sessions` (
763  `Id` varchar(26) NOT NULL,
764  `Token` varchar(26) DEFAULT NULL,
765  `CreateAt` bigint(20) DEFAULT NULL,
766  `ExpiresAt` bigint(20) DEFAULT NULL,
767  `LastActivityAt` bigint(20) DEFAULT NULL,
768  `UserId` varchar(26) DEFAULT NULL,
769  `DeviceId` text,
770  `Roles` varchar(64) DEFAULT NULL,
771  `IsOAuth` tinyint(1) DEFAULT NULL,
772  `ExpiredNotify` tinyint(1) DEFAULT NULL,
773  `Props` json DEFAULT NULL,
774  PRIMARY KEY (`Id`),
775  KEY `idx_sessions_user_id` (`UserId`),
776  KEY `idx_sessions_token` (`Token`),
777  KEY `idx_sessions_expires_at` (`ExpiresAt`),
778  KEY `idx_sessions_create_at` (`CreateAt`),
779  KEY `idx_sessions_last_activity_at` (`LastActivityAt`)
780);
781/*!40101 SET character_set_client = @saved_cs_client */;
782
783--
784-- Table structure for table `SharedChannelAttachments`
785--
786
787/*!40101 SET @saved_cs_client     = @@character_set_client */;
788/*!40101 SET character_set_client = utf8 */;
789CREATE TABLE `SharedChannelAttachments` (
790  `Id` varchar(26) NOT NULL,
791  `FileId` varchar(26) DEFAULT NULL,
792  `RemoteId` varchar(26) DEFAULT NULL,
793  `CreateAt` bigint(20) DEFAULT NULL,
794  `LastSyncAt` bigint(20) DEFAULT NULL,
795  PRIMARY KEY (`Id`),
796  UNIQUE KEY `FileId` (`FileId`,`RemoteId`)
797);
798/*!40101 SET character_set_client = @saved_cs_client */;
799
800--
801-- Table structure for table `SharedChannelRemotes`
802--
803
804/*!40101 SET @saved_cs_client     = @@character_set_client */;
805/*!40101 SET character_set_client = utf8 */;
806CREATE TABLE `SharedChannelRemotes` (
807  `Id` varchar(26) NOT NULL,
808  `ChannelId` varchar(26) NOT NULL,
809  `CreatorId` varchar(26) DEFAULT NULL,
810  `CreateAt` bigint(20) DEFAULT NULL,
811  `UpdateAt` bigint(20) DEFAULT NULL,
812  `IsInviteAccepted` tinyint(1) DEFAULT NULL,
813  `IsInviteConfirmed` tinyint(1) DEFAULT NULL,
814  `RemoteId` varchar(26) DEFAULT NULL,
815  `LastPostUpdateAt` bigint(20) DEFAULT NULL,
816  `LastPostId` varchar(26) DEFAULT NULL,
817  PRIMARY KEY (`Id`,`ChannelId`),
818  UNIQUE KEY `ChannelId` (`ChannelId`,`RemoteId`)
819);
820/*!40101 SET character_set_client = @saved_cs_client */;
821
822--
823-- Table structure for table `SharedChannelUsers`
824--
825
826/*!40101 SET @saved_cs_client     = @@character_set_client */;
827/*!40101 SET character_set_client = utf8 */;
828CREATE TABLE `SharedChannelUsers` (
829  `Id` varchar(26) NOT NULL,
830  `UserId` varchar(26) DEFAULT NULL,
831  `ChannelId` varchar(26) DEFAULT NULL,
832  `RemoteId` varchar(26) DEFAULT NULL,
833  `CreateAt` bigint(20) DEFAULT NULL,
834  `LastSyncAt` bigint(20) DEFAULT NULL,
835  PRIMARY KEY (`Id`),
836  UNIQUE KEY `UserId` (`UserId`,`ChannelId`,`RemoteId`),
837  KEY `idx_sharedchannelusers_remote_id` (`RemoteId`)
838);
839/*!40101 SET character_set_client = @saved_cs_client */;
840
841--
842-- Table structure for table `SharedChannels`
843--
844
845/*!40101 SET @saved_cs_client     = @@character_set_client */;
846/*!40101 SET character_set_client = utf8 */;
847CREATE TABLE `SharedChannels` (
848  `ChannelId` varchar(26) NOT NULL,
849  `TeamId` varchar(26) DEFAULT NULL,
850  `Home` tinyint(1) DEFAULT NULL,
851  `ReadOnly` tinyint(1) DEFAULT NULL,
852  `ShareName` varchar(64) DEFAULT NULL,
853  `ShareDisplayName` varchar(64) DEFAULT NULL,
854  `SharePurpose` varchar(250) DEFAULT NULL,
855  `ShareHeader` text,
856  `CreatorId` varchar(26) DEFAULT NULL,
857  `CreateAt` bigint(20) DEFAULT NULL,
858  `UpdateAt` bigint(20) DEFAULT NULL,
859  `RemoteId` varchar(26) DEFAULT NULL,
860  PRIMARY KEY (`ChannelId`),
861  UNIQUE KEY `ShareName` (`ShareName`,`TeamId`)
862);
863/*!40101 SET character_set_client = @saved_cs_client */;
864
865--
866-- Table structure for table `SidebarCategories`
867--
868
869/*!40101 SET @saved_cs_client     = @@character_set_client */;
870/*!40101 SET character_set_client = utf8 */;
871CREATE TABLE `SidebarCategories` (
872  `Id` varchar(128) NOT NULL,
873  `UserId` varchar(26) DEFAULT NULL,
874  `TeamId` varchar(26) DEFAULT NULL,
875  `SortOrder` bigint(20) DEFAULT NULL,
876  `Sorting` varchar(64) DEFAULT NULL,
877  `Type` varchar(64) DEFAULT NULL,
878  `DisplayName` varchar(64) DEFAULT NULL,
879  `Muted` tinyint(1) DEFAULT NULL,
880  `Collapsed` tinyint(1) DEFAULT NULL,
881  PRIMARY KEY (`Id`)
882);
883/*!40101 SET character_set_client = @saved_cs_client */;
884
885--
886-- Table structure for table `SidebarChannels`
887--
888
889/*!40101 SET @saved_cs_client     = @@character_set_client */;
890/*!40101 SET character_set_client = utf8 */;
891CREATE TABLE `SidebarChannels` (
892  `ChannelId` varchar(26) NOT NULL,
893  `UserId` varchar(26) NOT NULL,
894  `CategoryId` varchar(128) NOT NULL,
895  `SortOrder` bigint(20) DEFAULT NULL,
896  PRIMARY KEY (`ChannelId`,`UserId`,`CategoryId`)
897);
898/*!40101 SET character_set_client = @saved_cs_client */;
899
900--
901-- Table structure for table `Status`
902--
903
904/*!40101 SET @saved_cs_client     = @@character_set_client */;
905/*!40101 SET character_set_client = utf8 */;
906CREATE TABLE `Status` (
907  `UserId` varchar(26) NOT NULL,
908  `Status` varchar(32) DEFAULT NULL,
909  `Manual` tinyint(1) DEFAULT NULL,
910  `LastActivityAt` bigint(20) DEFAULT NULL,
911  `DNDEndTime` bigint(20) DEFAULT NULL,
912  `PrevStatus` varchar(32) DEFAULT NULL,
913  PRIMARY KEY (`UserId`),
914  KEY `idx_status_status_dndendtime` (`Status`,`DNDEndTime`)
915);
916/*!40101 SET character_set_client = @saved_cs_client */;
917
918--
919-- Table structure for table `Systems`
920--
921
922/*!40101 SET @saved_cs_client     = @@character_set_client */;
923/*!40101 SET character_set_client = utf8 */;
924CREATE TABLE `Systems` (
925  `Name` varchar(64) NOT NULL,
926  `Value` text,
927  PRIMARY KEY (`Name`)
928);
929/*!40101 SET character_set_client = @saved_cs_client */;
930
931--
932-- Table structure for table `TeamMembers`
933--
934
935/*!40101 SET @saved_cs_client     = @@character_set_client */;
936/*!40101 SET character_set_client = utf8 */;
937CREATE TABLE `TeamMembers` (
938  `TeamId` varchar(26) NOT NULL,
939  `UserId` varchar(26) NOT NULL,
940  `Roles` varchar(64) DEFAULT NULL,
941  `DeleteAt` bigint(20) DEFAULT NULL,
942  `SchemeUser` tinyint(4) DEFAULT NULL,
943  `SchemeAdmin` tinyint(4) DEFAULT NULL,
944  `SchemeGuest` tinyint(4) DEFAULT NULL,
945  PRIMARY KEY (`TeamId`,`UserId`),
946  KEY `idx_teammembers_user_id` (`UserId`),
947  KEY `idx_teammembers_delete_at` (`DeleteAt`)
948);
949/*!40101 SET character_set_client = @saved_cs_client */;
950
951--
952-- Table structure for table `Teams`
953--
954
955/*!40101 SET @saved_cs_client     = @@character_set_client */;
956/*!40101 SET character_set_client = utf8 */;
957CREATE TABLE `Teams` (
958  `Id` varchar(26) NOT NULL,
959  `CreateAt` bigint(20) DEFAULT NULL,
960  `UpdateAt` bigint(20) DEFAULT NULL,
961  `DeleteAt` bigint(20) DEFAULT NULL,
962  `DisplayName` varchar(64) DEFAULT NULL,
963  `Name` varchar(64) DEFAULT NULL,
964  `Description` varchar(255) DEFAULT NULL,
965  `Email` varchar(128) DEFAULT NULL,
966  `Type` varchar(255) DEFAULT NULL,
967  `CompanyName` varchar(64) DEFAULT NULL,
968  `AllowedDomains` text,
969  `InviteId` varchar(32) DEFAULT NULL,
970  `SchemeId` varchar(26) DEFAULT NULL,
971  `AllowOpenInvite` tinyint(1) DEFAULT NULL,
972  `LastTeamIconUpdate` bigint(20) DEFAULT NULL,
973  `GroupConstrained` tinyint(1) DEFAULT NULL,
974  PRIMARY KEY (`Id`),
975  UNIQUE KEY `Name` (`Name`),
976  KEY `idx_teams_invite_id` (`InviteId`),
977  KEY `idx_teams_update_at` (`UpdateAt`),
978  KEY `idx_teams_create_at` (`CreateAt`),
979  KEY `idx_teams_delete_at` (`DeleteAt`),
980  KEY `idx_teams_scheme_id` (`SchemeId`)
981);
982/*!40101 SET character_set_client = @saved_cs_client */;
983
984--
985-- Table structure for table `TermsOfService`
986--
987
988/*!40101 SET @saved_cs_client     = @@character_set_client */;
989/*!40101 SET character_set_client = utf8 */;
990CREATE TABLE `TermsOfService` (
991  `Id` varchar(26) NOT NULL,
992  `CreateAt` bigint(20) DEFAULT NULL,
993  `UserId` varchar(26) DEFAULT NULL,
994  `Text` text,
995  PRIMARY KEY (`Id`)
996);
997/*!40101 SET character_set_client = @saved_cs_client */;
998
999--
1000-- Table structure for table `ThreadMemberships`
1001--
1002
1003/*!40101 SET @saved_cs_client     = @@character_set_client */;
1004/*!40101 SET character_set_client = utf8 */;
1005CREATE TABLE `ThreadMemberships` (
1006  `PostId` varchar(26) NOT NULL,
1007  `UserId` varchar(26) NOT NULL,
1008  `Following` tinyint(1) DEFAULT NULL,
1009  `LastViewed` bigint(20) DEFAULT NULL,
1010  `LastUpdated` bigint(20) DEFAULT NULL,
1011  `UnreadMentions` bigint(20) DEFAULT NULL,
1012  PRIMARY KEY (`PostId`,`UserId`),
1013  KEY `idx_thread_memberships_last_update_at` (`LastUpdated`),
1014  KEY `idx_thread_memberships_last_view_at` (`LastViewed`),
1015  KEY `idx_thread_memberships_user_id` (`UserId`)
1016);
1017/*!40101 SET character_set_client = @saved_cs_client */;
1018
1019--
1020-- Table structure for table `Threads`
1021--
1022
1023/*!40101 SET @saved_cs_client     = @@character_set_client */;
1024/*!40101 SET character_set_client = utf8 */;
1025CREATE TABLE `Threads` (
1026  `PostId` varchar(26) NOT NULL,
1027  `ChannelId` varchar(26) DEFAULT NULL,
1028  `ReplyCount` bigint(20) DEFAULT NULL,
1029  `LastReplyAt` bigint(20) DEFAULT NULL,
1030  `Participants` json DEFAULT NULL,
1031  PRIMARY KEY (`PostId`),
1032  KEY `idx_threads_channel_id_last_reply_at` (`ChannelId`,`LastReplyAt`)
1033);
1034/*!40101 SET character_set_client = @saved_cs_client */;
1035
1036--
1037-- Table structure for table `Tokens`
1038--
1039
1040/*!40101 SET @saved_cs_client     = @@character_set_client */;
1041/*!40101 SET character_set_client = utf8 */;
1042CREATE TABLE `Tokens` (
1043  `Token` varchar(64) NOT NULL,
1044  `CreateAt` bigint(20) DEFAULT NULL,
1045  `Type` varchar(64) DEFAULT NULL,
1046  `Extra` text,
1047  PRIMARY KEY (`Token`)
1048);
1049/*!40101 SET character_set_client = @saved_cs_client */;
1050
1051--
1052-- Table structure for table `UploadSessions`
1053--
1054
1055/*!40101 SET @saved_cs_client     = @@character_set_client */;
1056/*!40101 SET character_set_client = utf8 */;
1057CREATE TABLE `UploadSessions` (
1058  `Id` varchar(26) NOT NULL,
1059  `Type` varchar(32) DEFAULT NULL,
1060  `CreateAt` bigint(20) DEFAULT NULL,
1061  `UserId` varchar(26) DEFAULT NULL,
1062  `ChannelId` varchar(26) DEFAULT NULL,
1063  `Filename` text,
1064  `Path` text,
1065  `FileSize` bigint(20) DEFAULT NULL,
1066  `FileOffset` bigint(20) DEFAULT NULL,
1067  `RemoteId` varchar(26) DEFAULT NULL,
1068  `ReqFileId` varchar(26) DEFAULT NULL,
1069  PRIMARY KEY (`Id`),
1070  KEY `idx_uploadsessions_user_id` (`Type`),
1071  KEY `idx_uploadsessions_create_at` (`CreateAt`)
1072);
1073/*!40101 SET character_set_client = @saved_cs_client */;
1074
1075--
1076-- Table structure for table `UserAccessTokens`
1077--
1078
1079/*!40101 SET @saved_cs_client     = @@character_set_client */;
1080/*!40101 SET character_set_client = utf8 */;
1081CREATE TABLE `UserAccessTokens` (
1082  `Id` varchar(26) NOT NULL,
1083  `Token` varchar(26) DEFAULT NULL,
1084  `UserId` varchar(26) DEFAULT NULL,
1085  `Description` text,
1086  `IsActive` tinyint(1) DEFAULT NULL,
1087  PRIMARY KEY (`Id`),
1088  UNIQUE KEY `Token` (`Token`),
1089  KEY `idx_user_access_tokens_user_id` (`UserId`)
1090);
1091/*!40101 SET character_set_client = @saved_cs_client */;
1092
1093--
1094-- Table structure for table `UserGroups`
1095--
1096
1097/*!40101 SET @saved_cs_client     = @@character_set_client */;
1098/*!40101 SET character_set_client = utf8 */;
1099CREATE TABLE `UserGroups` (
1100  `Id` varchar(26) NOT NULL,
1101  `Name` varchar(64) DEFAULT NULL,
1102  `DisplayName` varchar(128) DEFAULT NULL,
1103  `Description` text,
1104  `Source` varchar(64) DEFAULT NULL,
1105  `RemoteId` varchar(48) DEFAULT NULL,
1106  `CreateAt` bigint(20) DEFAULT NULL,
1107  `UpdateAt` bigint(20) DEFAULT NULL,
1108  `DeleteAt` bigint(20) DEFAULT NULL,
1109  `AllowReference` tinyint(1) DEFAULT NULL,
1110  PRIMARY KEY (`Id`),
1111  UNIQUE KEY `Name` (`Name`),
1112  UNIQUE KEY `Source` (`Source`,`RemoteId`),
1113  KEY `idx_usergroups_remote_id` (`RemoteId`),
1114  KEY `idx_usergroups_delete_at` (`DeleteAt`)
1115);
1116/*!40101 SET character_set_client = @saved_cs_client */;
1117
1118--
1119-- Table structure for table `UserTermsOfService`
1120--
1121
1122/*!40101 SET @saved_cs_client     = @@character_set_client */;
1123/*!40101 SET character_set_client = utf8 */;
1124CREATE TABLE `UserTermsOfService` (
1125  `UserId` varchar(26) NOT NULL,
1126  `TermsOfServiceId` varchar(26) DEFAULT NULL,
1127  `CreateAt` bigint(20) DEFAULT NULL,
1128  PRIMARY KEY (`UserId`)
1129);
1130/*!40101 SET character_set_client = @saved_cs_client */;
1131
1132--
1133-- Table structure for table `Users`
1134--
1135
1136/*!40101 SET @saved_cs_client     = @@character_set_client */;
1137/*!40101 SET character_set_client = utf8 */;
1138CREATE TABLE `Users` (
1139  `Id` varchar(26) NOT NULL,
1140  `CreateAt` bigint(20) DEFAULT NULL,
1141  `UpdateAt` bigint(20) DEFAULT NULL,
1142  `DeleteAt` bigint(20) DEFAULT NULL,
1143  `Username` varchar(64) DEFAULT NULL,
1144  `Password` varchar(128) DEFAULT NULL,
1145  `AuthData` varchar(128) DEFAULT NULL,
1146  `AuthService` varchar(32) DEFAULT NULL,
1147  `Email` varchar(128) DEFAULT NULL,
1148  `EmailVerified` tinyint(1) DEFAULT NULL,
1149  `Nickname` varchar(64) DEFAULT NULL,
1150  `FirstName` varchar(64) DEFAULT NULL,
1151  `LastName` varchar(64) DEFAULT NULL,
1152  `Position` varchar(128) DEFAULT NULL,
1153  `Roles` text,
1154  `AllowMarketing` tinyint(1) DEFAULT NULL,
1155  `Props` json DEFAULT NULL,
1156  `NotifyProps` json DEFAULT NULL,
1157  `LastPasswordUpdate` bigint(20) DEFAULT NULL,
1158  `LastPictureUpdate` bigint(20) DEFAULT NULL,
1159  `FailedAttempts` int(11) DEFAULT NULL,
1160  `Locale` varchar(5) DEFAULT NULL,
1161  `Timezone` json DEFAULT NULL,
1162  `MfaActive` tinyint(1) DEFAULT NULL,
1163  `MfaSecret` varchar(128) DEFAULT NULL,
1164  `RemoteId` varchar(26) DEFAULT NULL,
1165  PRIMARY KEY (`Id`),
1166  UNIQUE KEY `Username` (`Username`),
1167  UNIQUE KEY `AuthData` (`AuthData`),
1168  UNIQUE KEY `Email` (`Email`),
1169  KEY `idx_users_update_at` (`UpdateAt`),
1170  KEY `idx_users_create_at` (`CreateAt`),
1171  KEY `idx_users_delete_at` (`DeleteAt`),
1172  FULLTEXT KEY `idx_users_all_txt` (`Username`,`FirstName`,`LastName`,`Nickname`,`Email`),
1173  FULLTEXT KEY `idx_users_all_no_full_name_txt` (`Username`,`Nickname`,`Email`),
1174  FULLTEXT KEY `idx_users_names_txt` (`Username`,`FirstName`,`LastName`,`Nickname`),
1175  FULLTEXT KEY `idx_users_names_no_full_name_txt` (`Username`,`Nickname`)
1176);
1177/*!40101 SET character_set_client = @saved_cs_client */;
1178
1179--
1180-- Table structure for table `schema_migrations`
1181--
1182
1183/*!40101 SET @saved_cs_client     = @@character_set_client */;
1184/*!40101 SET character_set_client = utf8 */;
1185CREATE TABLE `schema_migrations` (
1186  `version` bigint(20) NOT NULL,
1187  `dirty` tinyint(1) NOT NULL,
1188  PRIMARY KEY (`version`)
1189);
1190/*!40101 SET character_set_client = @saved_cs_client */;
1191/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
1192
1193/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
1194/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
1195/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
1196/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
1197
1198-- Dump completed on 2021-08-31 11:45:07
1199