|
1 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> |
2 | | -<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="22758" systemVersion="23C71" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier=""> |
| 2 | +<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="22758" systemVersion="23G93" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier=""> |
3 | 3 | <entity name="AttachmentDTO" representedClassName="AttachmentDTO" syncable="YES"> |
4 | 4 | <attribute name="data" attributeType="Binary"/> |
5 | 5 | <attribute name="id" attributeType="String"/> |
| 6 | + <attribute name="localDownloadStateRaw" optional="YES" attributeType="String"/> |
6 | 7 | <attribute name="localProgress" attributeType="Double" minValueString="0" maxValueString="1" defaultValueString="0.0" usesScalarValueType="YES"/> |
| 8 | + <attribute name="localRelativePath" optional="YES" attributeType="String"/> |
7 | 9 | <attribute name="localStateRaw" optional="YES" attributeType="String"/> |
8 | 10 | <attribute name="localURL" optional="YES" attributeType="URI"/> |
9 | 11 | <attribute name="type" optional="YES" attributeType="String"/> |
|
20 | 22 | <attribute name="maxMessageLength" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/> |
21 | 23 | <attribute name="messageRetention" attributeType="String" defaultValueString=""/> |
22 | 24 | <attribute name="mutesEnabled" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/> |
| 25 | + <attribute name="pollsEnabled" optional="YES" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/> |
23 | 26 | <attribute name="quotesEnabled" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/> |
24 | 27 | <attribute name="reactionsEnabled" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/> |
25 | 28 | <attribute name="readEventsEnabled" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/> |
|
36 | 39 | <attribute name="cid" attributeType="String"/> |
37 | 40 | <attribute name="cooldownDuration" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/> |
38 | 41 | <attribute name="createdAt" attributeType="Date" usesScalarValueType="NO"/> |
| 42 | + <attribute name="currentUserUnreadMessagesCount" attributeType="Integer 32" defaultValueString="0" usesScalarValueType="YES"/> |
39 | 43 | <attribute name="defaultSortingAt" attributeType="Date" usesScalarValueType="NO" spotlightIndexingEnabled="YES"/> |
40 | 44 | <attribute name="deletedAt" optional="YES" attributeType="Date" usesScalarValueType="NO"/> |
41 | 45 | <attribute name="extraData" attributeType="Binary"/> |
42 | 46 | <attribute name="imageURL" optional="YES" attributeType="URI"/> |
| 47 | + <attribute name="isBlocked" optional="YES" attributeType="Boolean" usesScalarValueType="YES"/> |
43 | 48 | <attribute name="isFrozen" attributeType="Boolean" usesScalarValueType="YES"/> |
44 | 49 | <attribute name="isHidden" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/> |
45 | 50 | <attribute name="lastMessageAt" optional="YES" attributeType="Date" usesScalarValueType="NO"/> |
|
132 | 137 | <relationship name="channelConfig" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="ChannelConfigDTO" inverseName="commands" inverseEntity="ChannelConfigDTO"/> |
133 | 138 | </entity> |
134 | 139 | <entity name="CurrentUserDTO" representedClassName="CurrentUserDTO" syncable="YES"> |
| 140 | + <attribute name="blockedUserIds" optional="YES" attributeType="Transformable" valueTransformerName="NSSecureUnarchiveFromDataTransformer"/> |
135 | 141 | <attribute name="isInvisible" attributeType="Boolean" defaultValueString="NO" usesScalarValueType="YES"/> |
136 | 142 | <attribute name="isReadReceiptsEnabled" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES"/> |
137 | 143 | <attribute name="isTypingIndicatorsEnabled" attributeType="Boolean" defaultValueString="YES" usesScalarValueType="YES"/> |
138 | 144 | <attribute name="lastSynchedEventDate" optional="YES" attributeType="Date" usesScalarValueType="NO"/> |
139 | 145 | <attribute name="uniquenessKey" attributeType="String" defaultValueString="this is an immmutable arbitrary key which makes sure we have only once instance of CurrentUserDTO in the db"/> |
140 | 146 | <attribute name="unreadChannelsCount" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/> |
141 | 147 | <attribute name="unreadMessagesCount" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/> |
| 148 | + <attribute name="unreadThreadsCount" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/> |
142 | 149 | <relationship name="channelMutes" optional="YES" toMany="YES" deletionRule="Cascade" destinationEntity="ChannelMuteDTO" inverseName="currentUser" inverseEntity="ChannelMuteDTO"/> |
143 | 150 | <relationship name="currentDevice" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="DeviceDTO" inverseName="relationship" inverseEntity="DeviceDTO"/> |
144 | 151 | <relationship name="devices" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="DeviceDTO" inverseName="user" inverseEntity="DeviceDTO"/> |
|
323 | 330 | <attribute name="voteCountsByOption" optional="YES" attributeType="Transformable" valueTransformerName="NSSecureUnarchiveFromData"/> |
324 | 331 | <attribute name="votingVisibility" optional="YES" attributeType="String"/> |
325 | 332 | <relationship name="createdBy" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="UserDTO" inverseName="pollCreatedBy" inverseEntity="UserDTO"/> |
326 | | - <relationship name="latestAnswers" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="PollVoteDTO" inverseName="poll" inverseEntity="PollVoteDTO"/> |
| 333 | + <relationship name="latestVotes" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="PollVoteDTO" inverseName="poll" inverseEntity="PollVoteDTO"/> |
327 | 334 | <relationship name="latestVotesByOption" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="PollOptionDTO" inverseName="pollLatestVotes" inverseEntity="PollOptionDTO"/> |
328 | 335 | <relationship name="message" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="MessageDTO" inverseName="poll" inverseEntity="MessageDTO"/> |
329 | | - <relationship name="options" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="PollOptionDTO" inverseName="poll" inverseEntity="PollOptionDTO"/> |
| 336 | + <relationship name="options" optional="YES" toMany="YES" deletionRule="Nullify" ordered="YES" destinationEntity="PollOptionDTO" inverseName="poll" inverseEntity="PollOptionDTO"/> |
330 | 337 | </entity> |
331 | 338 | <entity name="PollOptionDTO" representedClassName="PollOptionDTO" syncable="YES"> |
332 | 339 | <attribute name="custom" optional="YES" attributeType="Binary"/> |
|
345 | 352 | <attribute name="pollId" attributeType="String"/> |
346 | 353 | <attribute name="updatedAt" attributeType="Date" usesScalarValueType="NO"/> |
347 | 354 | <relationship name="option" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="PollOptionDTO" inverseName="latestVotes" inverseEntity="PollOptionDTO"/> |
348 | | - <relationship name="poll" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="PollDTO" inverseName="latestAnswers" inverseEntity="PollDTO"/> |
| 355 | + <relationship name="poll" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="PollDTO" inverseName="latestVotes" inverseEntity="PollDTO"/> |
349 | 356 | <relationship name="queries" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="PollVoteListQueryDTO" inverseName="votes" inverseEntity="PollVoteListQueryDTO"/> |
350 | 357 | <relationship name="user" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="UserDTO" inverseName="votes" inverseEntity="UserDTO"/> |
351 | 358 | </entity> |
|
372 | 379 | <fetchIndex name="filterHash"> |
373 | 380 | <fetchIndexElement property="filterHash" type="Binary" order="ascending"/> |
374 | 381 | </fetchIndex> |
| 382 | + <uniquenessConstraints> |
| 383 | + <uniquenessConstraint> |
| 384 | + <constraint value="filterHash"/> |
| 385 | + </uniquenessConstraint> |
| 386 | + </uniquenessConstraints> |
375 | 387 | </entity> |
376 | 388 | <entity name="ThreadDTO" representedClassName="ThreadDTO" syncable="YES"> |
377 | 389 | <attribute name="createdAt" optional="YES" attributeType="Date" usesScalarValueType="NO"/> |
| 390 | + <attribute name="currentUserUnreadCount" optional="YES" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/> |
| 391 | + <attribute name="extraData" optional="YES" attributeType="Binary"/> |
378 | 392 | <attribute name="lastMessageAt" optional="YES" attributeType="Date" usesScalarValueType="NO"/> |
379 | 393 | <attribute name="parentMessageId" optional="YES" attributeType="String"/> |
380 | 394 | <attribute name="participantCount" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/> |
|
434 | 448 | <relationship name="mutedBy" toMany="YES" deletionRule="Nullify" destinationEntity="CurrentUserDTO" inverseName="mutedUsers" inverseEntity="CurrentUserDTO"/> |
435 | 449 | <relationship name="participatedThreads" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="MessageDTO" inverseName="threadParticipants" inverseEntity="MessageDTO"/> |
436 | 450 | <relationship name="pinnedMessages" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="MessageDTO" inverseName="pinnedBy" inverseEntity="MessageDTO"/> |
437 | | - <relationship name="pollCreatedBy" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="PollDTO" inverseName="createdBy" inverseEntity="PollDTO"/> |
| 451 | + <relationship name="pollCreatedBy" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="PollDTO" inverseName="createdBy" inverseEntity="PollDTO"/> |
438 | 452 | <relationship name="queries" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="UserListQueryDTO" inverseName="users" inverseEntity="UserListQueryDTO"/> |
439 | 453 | <relationship name="reactions" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="MessageReactionDTO" inverseName="user" inverseEntity="MessageReactionDTO"/> |
440 | 454 | <relationship name="threadReads" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="ThreadReadDTO" inverseName="user" inverseEntity="ThreadReadDTO"/> |
|
0 commit comments