# CREATE TABLE message (
MESSAGE_ROWID = 0  # ROWID INTEGER PRIMARY KEY AUTOINCREMENT,
MESSAGE_GUID = 1  # guid TEXT UNIQUE NOT NULL,
MESSAGE_TEXT = 2  # text TEXT,
MESSAGE_REPLACE = 3  # replace INTEGER DEFAULT 0,
MESSAGE_SERVICE_CENTER = 4  # service_center TEXT,
MESSAGE_HANDLE_ID = 5  # handle_id INTEGER DEFAULT 0,
MESSAGE_SUBJECT = 6  # subject TEXT,
MESSAGE_COUNTRY = 7  # country TEXT,
MESSAGE_ATTRIBUTEDBODY = 8  # attributedBody BLOB,
MESSAGE_VERSION = 9  # version INTEGER DEFAULT 0,
MESSAGE_TYPE = 10  # type INTEGER DEFAULT 0,
MESSAGE_SERVICE = 11  # service TEXT,
MESSAGE_ACCOUNT = 12  # account TEXT,
MESSAGE_ACCOUNT_GUID = 13  # account_guid TEXT,
MESSAGE_ERROR = 14  # error INTEGER DEFAULT 0,
MESSAGE_DATE = 15  # date INTEGER,
MESSAGE_DATE_READ = 16  # date_read INTEGER,
MESSAGE_DATE_DELIVERED = 17  # date_delivered INTEGER,
MESSAGE_IS_DELIVERED = 18  # is_delivered INTEGER DEFAULT 0,
MESSAGE_IS_FINISHED = 19  # is_finished INTEGER DEFAULT 0,
MESSAGE_IS_EMOTE = 20  # is_emote INTEGER DEFAULT 0,
MESSAGE_IS_FROM_ME = 21  # is_from_me INTEGER DEFAULT 0,
MESSAGE_IS_EMPTY = 22  # is_empty INTEGER DEFAULT 0,
MESSAGE_IS_DELAYED = 23  # is_delayed INTEGER DEFAULT 0,
MESSAGE_IS_AUTO_REPLY = 24  # is_auto_reply INTEGER DEFAULT 0,
MESSAGE_IS_PREPARED = 25  # is_prepared INTEGER DEFAULT 0,
MESSAGE_IS_READ = 26  # is_read INTEGER DEFAULT 0,
MESSAGE_IS_SYSTEM_MESSAGE = 27  # is_system_message INTEGER DEFAULT 0,
MESSAGE_IS_SENT = 28  # is_sent INTEGER DEFAULT 0,
MESSAGE_HAS_DD_RESULTS = 29  # has_dd_results INTEGER DEFAULT 0,
MESSAGE_IS_SERVICE_MESSAGE = 30  # is_service_message INTEGER DEFAULT 0,
MESSAGE_IS_FORWARD = 31  # is_forward INTEGER DEFAULT 0,
MESSAGE_WAS_DOWNGRADED = 32  # was_downgraded INTEGER DEFAULT 0,
MESSAGE_IS_ARCHIVE = 33  # is_archive INTEGER DEFAULT 0,
MESSAGE_CACHE_HAS_ATTACHMENTS = 34  # cache_has_attachments INTEGER DEFAULT 0,
MESSAGE_CACHE_ROOMNAMES = 35  # cache_roomnames TEXT,
MESSAGE_WAS_DATA_DETECTED = 36  # was_data_detected INTEGER DEFAULT 0,
MESSAGE_WAS_DEDUPLICATED = 37  # was_deduplicated INTEGER DEFAULT 0
MESSAGE_IS_AUDIO_MESSAGE = 38  # is_audio_message INTEGER DEFAULT 0
MESSAGE_IS_PLAYED = 39  # is_played INTEGER DEFAULT 0
MESSAGE_DATE_PLAYED = 40  # date_played INTEGER
MESSAGE_ITEM_TYPE = 41  # item_type INTEGER DEFAULT 0
MESSAGE_OTHER_HANDLE = 42  # other_handle INTEGER DEFAULT 0
MESSAGE_GROUP_TITLE = 43  # group_title TEXT
MESSAGE_GROUP_ACTION_TYPE = 44  # group_action_type INTEGER DEFAULT 0
MESSAGE_SHARE_STATUS = 45  # share_status INTEGER DEFAULT 0
MESSAGE_SHARE_DIRECTION = 46  # share_direction INTEGER DEFAULT 0
MESSAGE_IS_EXPIRABLE = 47  # is_expirable INTEGER DEFAULT 0
MESSAGE_EXPIRE_STATE = 48  # expire_state INTEGER DEFAULT 0
MESSAGE_MESSAGE_ACTION_TYPE = 49  # message_action_type INTEGER DEFAULT 0
MESSAGE_MESSAGE_SOURCE = 50  # message_source INTEGER DEFAULT 0
MESSAGE_ASSOCIATED_MESSAGE_GUID = 51  # associated_message_guid TEXT
MESSAGE_ASSOCIATED_MESSAGE_TYPE = 52  # associated_message_type INTEGER DEFAULT 0
MESSAGE_BALLOON_BUNDLE_ID = 53  # balloon_bundle_id TEXT
MESSAGE_PAYLOAD_DATA = 54  # payload_data BLOB
MESSAGE_EXPRESSIVE_SEND_STYLE_ID = 55  # expressive_send_style_id TEXT
MESSAGE_ASSOCIATED_MESSAGE_RANGE_LOCATION = 56  # associated_message_range_location INTEGER DEFAULT 0
MESSAGE_ASSOCIATED_MESSAGE_RANGE_LENGTH = 57  # associated_message_range_length INTEGER DEFAULT 0
MESSAGE_TIME_EXPRESSIVE_SEND_PLAYED = 58  # time_expressive_send_played INTEGER
MESSAGE_MESSAGE_SUMMARY_INFO = 59  # message_summary_info BLOB
MESSAGE_CK_SYNC_STATE = 60  # ck_sync_state INTEGER DEFAULT 0
MESSAGE_CK_RECORD_ID = 61  # ck_record_id TEXT
MESSAGE_CK_RECORD_CHANGE_TAG = 62  # ck_record_change_tag TEXT
MESSAGE_DESTINATION_CALLER_ID = 63  # destination_caller_id TEXT
MESSAGE_IS_CORRUPT = 64  # is_corrupt INTEGER DEFAULT 0
MESSAGE_REPLY_TO_GUID = 65  # reply_to_guid TEXT
MESSAGE_SORT_ID = 66  # sort_id INTEGER
MESSAGE_IS_SPAM = 67  # is_spam INTEGER DEFAULT 0
MESSAGE_HAS_UNSEEN_MENTION = 68  # has_unseen_mention INTEGER DEFAULT 0
MESSAGE_THREAD_ORIGINATOR_GUID = 69  # thread_originator_guid TEXT
MESSAGE_THREAD_ORIGINATOR_PART = 70  # thread_originator_part TEXT
MESSAGE_SYNDICATION_RANGES = 71  # syndication_ranges TEXT
MESSAGE_SYNCED_SYNDICATION_RANGES = 72  # synced_syndication_ranges TEXT
MESSAGE_WAS_DELIVERED_QUIETLY = 73  # was_delivered_quietly INTEGER DEFAULT 0
MESSAGE_DID_NOTIFY_RECIPIENT = 74  # did_notify_recipient INTEGER DEFAULT 0
MESSAGE_DATE_RETRACTED = 75  # date_retracted INTEGER
MESSAGE_DATE_EDITED = 76  # date_edited INTEGER
MESSAGE_WAS_DETONATED = 77  # was_detonated INTEGER DEFAULT 0
MESSAGE_PART_COUNT = 78  # part_count INTEGER
MESSAGE_IS_STEWIE = 79  # is_stewie INTEGER DEFAULT 0
# );

# CREATE TABLE handle (
RECIPIENTS_ROWID = 0  # ROWID INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE,
RECIPIENTS_ID = 1  # id TEXT NOT NULL,
RECIPIENTS_COUNTRY = 2  # country TEXT,
RECIPIENTS_SERVICE_ID = 3  # service TEXT NOT NULL,
RECIPIENTS_NONCANONICAL_ID = 4  # uncanonicalized_id TEXT,
# UNIQUE (id, service)
# );
