iOS11.2.sql 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. CREATE TABLE _SqliteDatabaseProperties (
  2. key TEXT,
  3. value TEXT,
  4. UNIQUE(key)
  5. );
  6. CREATE TABLE deleted_messages (
  7. ROWID INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
  8. guid TEXT NOT NULL
  9. );
  10. CREATE TABLE sqlite_sequence(name,seq);
  11. CREATE TABLE chat_handle_join (
  12. chat_id INTEGER REFERENCES chat (ROWID) ON DELETE CASCADE,
  13. handle_id INTEGER REFERENCES handle (ROWID) ON DELETE CASCADE,
  14. UNIQUE(chat_id, handle_id)
  15. );
  16. CREATE TABLE sync_deleted_messages (
  17. ROWID INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
  18. guid TEXT NOT NULL,
  19. recordID TEXT
  20. );
  21. CREATE TABLE message_processing_task (
  22. ROWID INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
  23. guid TEXT NOT NULL,
  24. task_flags INTEGER NOT NULL
  25. );
  26. CREATE TABLE handle (
  27. ROWID INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
  28. id TEXT NOT NULL,
  29. country TEXT,
  30. service TEXT NOT NULL,
  31. uncanonicalized_id TEXT,
  32. UNIQUE (id, service)
  33. );
  34. CREATE TABLE sync_deleted_chats (
  35. ROWID INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
  36. guid TEXT NOT NULL,
  37. recordID TEXT,
  38. timestamp INTEGER
  39. );
  40. CREATE TABLE message_attachment_join (
  41. message_id INTEGER REFERENCES message (ROWID) ON DELETE CASCADE,
  42. attachment_id INTEGER REFERENCES attachment (ROWID) ON DELETE CASCADE,
  43. UNIQUE(message_id, attachment_id)
  44. );
  45. CREATE TABLE sync_deleted_attachments (
  46. ROWID INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
  47. guid TEXT NOT NULL,
  48. recordID TEXT
  49. );
  50. CREATE TABLE kvtable (
  51. ROWID INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
  52. key TEXT UNIQUE NOT NULL,
  53. value BLOB NOT NULL
  54. );
  55. CREATE TABLE chat_message_join (
  56. chat_id INTEGER REFERENCES chat (ROWID) ON DELETE CASCADE,
  57. message_id INTEGER REFERENCES message (ROWID) ON DELETE CASCADE,
  58. message_date INTEGER DEFAULT 0,
  59. PRIMARY KEY (chat_id, message_id)
  60. );
  61. CREATE TABLE message (
  62. ROWID INTEGER PRIMARY KEY AUTOINCREMENT,
  63. guid TEXT UNIQUE NOT NULL,
  64. text TEXT,
  65. replace INTEGER DEFAULT 0,
  66. service_center TEXT,
  67. handle_id INTEGER DEFAULT 0,
  68. subject TEXT,
  69. country TEXT,
  70. attributedBody BLOB,
  71. version INTEGER DEFAULT 0,
  72. type INTEGER DEFAULT 0,
  73. service TEXT,
  74. account TEXT,
  75. account_guid TEXT,
  76. error INTEGER DEFAULT 0,
  77. date INTEGER,
  78. date_read INTEGER,
  79. date_delivered INTEGER,
  80. is_delivered INTEGER DEFAULT 0,
  81. is_finished INTEGER DEFAULT 0,
  82. is_emote INTEGER DEFAULT 0,
  83. is_from_me INTEGER DEFAULT 0,
  84. is_empty INTEGER DEFAULT 0,
  85. is_delayed INTEGER DEFAULT 0,
  86. is_auto_reply INTEGER DEFAULT 0,
  87. is_prepared INTEGER DEFAULT 0,
  88. is_read INTEGER DEFAULT 0,
  89. is_system_message INTEGER DEFAULT 0,
  90. is_sent INTEGER DEFAULT 0,
  91. has_dd_results INTEGER DEFAULT 0,
  92. is_service_message INTEGER DEFAULT 0,
  93. is_forward INTEGER DEFAULT 0,
  94. was_downgraded INTEGER DEFAULT 0,
  95. is_archive INTEGER DEFAULT 0,
  96. cache_has_attachments INTEGER DEFAULT 0,
  97. cache_roomnames TEXT,
  98. was_data_detected INTEGER DEFAULT 0,
  99. was_deduplicated INTEGER DEFAULT 0,
  100. is_audio_message INTEGER DEFAULT 0,
  101. is_played INTEGER DEFAULT 0,
  102. date_played INTEGER,
  103. item_type INTEGER DEFAULT 0,
  104. other_handle INTEGER DEFAULT 0,
  105. group_title TEXT,
  106. group_action_type INTEGER DEFAULT 0,
  107. share_status INTEGER DEFAULT 0,
  108. share_direction INTEGER DEFAULT 0,
  109. is_expirable INTEGER DEFAULT 0,
  110. expire_state INTEGER DEFAULT 0,
  111. message_action_type INTEGER DEFAULT 0,
  112. message_source INTEGER DEFAULT 0,
  113. associated_message_guid TEXT,
  114. associated_message_type INTEGER DEFAULT 0,
  115. balloon_bundle_id TEXT,
  116. payload_data BLOB,
  117. expressive_send_style_id TEXT,
  118. associated_message_range_location INTEGER DEFAULT 0,
  119. associated_message_range_length INTEGER DEFAULT 0,
  120. time_expressive_send_played INTEGER,
  121. message_summary_info BLOB,
  122. ck_sync_state
  123. INTEGER DEFAULT 0,
  124. ck_record_id TEXT,
  125. ck_record_change_tag TEXT,
  126. destination_caller_id TEXT
  127. );
  128. CREATE TABLE chat (
  129. ROWID INTEGER PRIMARY KEY AUTOINCREMENT,
  130. guid TEXT UNIQUE NOT NULL,
  131. style INTEGER,
  132. state INTEGER,
  133. account_id TEXT,
  134. properties BLOB,
  135. chat_identifier TEXT,
  136. service_name TEXT,
  137. room_name TEXT,
  138. account_login TEXT,
  139. is_archived INTEGER DEFAULT 0,
  140. last_addressed_handle TEXT,
  141. display_name TEXT,
  142. group_id TEXT,
  143. is_filtered INTEGER,
  144. successful_query INTEGER,
  145. engram_id TEXT,
  146. server_change_token TEXT,
  147. ck_sync_state INTEGER DEFAULT 0,
  148. original_group_id TEXT,
  149. last_read_message_timestamp INTEGER DEFAULT 0,
  150. ck_record_system_property_blob BLOB
  151. );
  152. CREATE TABLE attachment (
  153. ROWID INTEGER PRIMARY KEY AUTOINCREMENT,
  154. guid TEXT UNIQUE NOT NULL,
  155. created_date INTEGER DEFAULT 0,
  156. start_date INTEGER DEFAULT 0,
  157. filename TEXT,
  158. uti TEXT,
  159. mime_type TEXT,
  160. transfer_state INTEGER DEFAULT 0,
  161. is_outgoing INTEGER DEFAULT 0,
  162. user_info BLOB,
  163. transfer_name TEXT,
  164. total_bytes INTEGER DEFAULT 0,
  165. is_sticker INTEGER DEFAULT 0,
  166. sticker_user_info BLOB,
  167. attribution_info BLOB,
  168. hide_attachment INTEGER DEFAULT 0,
  169. ck_sync_state INTEGER DEFAULT 0,
  170. ck_server_change_token_blob BLOB,
  171. ck_record_id TEXT,
  172. original_guid TEXT UNIQUE NOT NULL
  173. );
  174. CREATE TABLE sqlite_stat1(tbl,idx,stat);