| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- import { appSchema, tableSchema } from '@nozbe/watermelondb';
- export default appSchema({
- version: 1,
- tables: [
- tableSchema({
- name: 'chats',
- columns: [
- { name: 'chat_uid', type: 'number', isOptional: true, isIndexed: true },
- { name: 'group_chat_token', type: 'string', isOptional: true, isIndexed: true },
- { name: 'name', type: 'string' },
- { name: 'avatar', type: 'string', isOptional: true },
- { name: 'avatar_local', type: 'string', isOptional: true },
- { name: 'avatar_etag', type: 'string', isOptional: true },
- { name: 'avatar_checked_at', type: 'number', isOptional: true },
- { name: 'short', type: 'string' },
- { name: 'sent_by', type: 'number' },
- { name: 'updated', type: 'number', isIndexed: true },
- { name: 'status', type: 'number' },
- { name: 'unread_count', type: 'number' },
- { name: 'last_message_id', type: 'number' },
- { name: 'pin', type: 'number' },
- { name: 'pin_order', type: 'number' },
- { name: 'archive', type: 'number' },
- { name: 'archive_order', type: 'number' },
- { name: 'attachement_name', type: 'string' },
- { name: 'encrypted', type: 'number' },
- { name: 'muted', type: 'number' },
- { name: 'user_type', type: 'string', isOptional: true },
- { name: 'group_avatar', type: 'string', isOptional: true },
- { name: 'can_send_messages', type: 'number', isOptional: true },
- { name: 'is_admin', type: 'number', isOptional: true },
- { name: 'announcement', type: 'number', isOptional: true },
- { name: 'is_dirty', type: 'boolean', isOptional: true },
- { name: 'dirty_actions', type: 'string', isOptional: true },
- { name: 'removed', type: 'boolean', isOptional: true }
- ]
- }),
- tableSchema({
- name: 'messages',
- columns: [
- { name: 'composite_id', type: 'string', isIndexed: true },
- { name: 'message_id', type: 'string' },
- { name: 'chat_uid', type: 'number', isOptional: true, isIndexed: true },
- { name: 'sender_id', type: 'number' },
- { name: 'recipient_id', type: 'number' },
- { name: 'text', type: 'string', isOptional: true },
- { name: 'timestamp', type: 'number', isIndexed: true },
- { name: 'received_at', type: 'number', isOptional: true },
- { name: 'read_at', type: 'number', isOptional: true },
- { name: 'status', type: 'string' },
- { name: 'deleted', type: 'boolean', isOptional: true },
- { name: 'reactions', type: 'string', isOptional: true },
- { name: 'edits', type: 'string', isOptional: true },
- { name: 'attachments', type: 'string', isOptional: true },
- { name: 'reply_to', type: 'number', isOptional: true },
- { name: 'encrypted', type: 'number', isOptional: true },
- { name: 'sender_name', type: 'string', isOptional: true },
- { name: 'sender_avatar', type: 'string', isOptional: true },
- { name: 'is_dirty', type: 'boolean', isOptional: true },
- { name: 'dirty_actions', type: 'string', isOptional: true }
- ]
- }),
- tableSchema({
- name: 'blocked_users',
- columns: [
- { name: 'user_id', type: 'number', isIndexed: true },
- { name: 'first_name', type: 'string' },
- { name: 'last_name', type: 'string' },
- { name: 'avatar', type: 'string', isOptional: true },
- { name: 'removed', type: 'boolean', isOptional: true },
- { name: 'is_dirty', type: 'boolean', isOptional: true },
- { name: 'dirty_actions', type: 'string', isOptional: true }
- ]
- })
- ]
- });
|