CREATE TABLE ZWABLACKLISTITEM ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZJID VARCHAR );
CREATE TABLE ZWACHATPROPERTIES ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZALERTS INTEGER, ZENABLED INTEGER, ZCHATSESSION INTEGER, ZMUTEDATE TIMESTAMP, ZSOUNDNAME VARCHAR );
CREATE TABLE ZWACHATPUSHCONFIG ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZALERTS INTEGER, ZMUTEDUNTIL TIMESTAMP, ZJID VARCHAR, ZRINGTONE VARCHAR, ZSOUND VARCHAR );
CREATE TABLE ZWACHATSESSION ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZARCHIVED INTEGER, ZCONTACTABID INTEGER, ZFLAGS INTEGER, ZHIDDEN INTEGER, ZIDENTITYVERIFICATIONEPOCH INTEGER, ZIDENTITYVERIFICATIONSTATE INTEGER, ZMESSAGECOUNTER INTEGER, ZREMOVED INTEGER, ZSESSIONTYPE INTEGER, ZSPOTLIGHTSTATUS INTEGER, ZUNREADCOUNT INTEGER, ZGROUPINFO INTEGER, ZLASTMESSAGE INTEGER, ZPROPERTIES INTEGER, ZLASTMESSAGEDATE TIMESTAMP, ZLOCATIONSHARINGENDDATE TIMESTAMP, ZCONTACTIDENTIFIER VARCHAR, ZCONTACTJID VARCHAR, ZETAG VARCHAR, ZLASTMESSAGETEXT VARCHAR, ZPARTNERNAME VARCHAR, ZSAVEDINPUT VARCHAR );
CREATE TABLE ZWAGROUPINFO ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZSTATE INTEGER, ZCHATSESSION INTEGER, ZLASTMESSAGEOWNER INTEGER, ZCREATIONDATE TIMESTAMP, ZSUBJECTTIMESTAMP TIMESTAMP, ZCREATORJID VARCHAR, ZOWNERJID VARCHAR, ZPICTUREID VARCHAR, ZPICTUREPATH VARCHAR, ZSOURCEJID VARCHAR, ZSUBJECTOWNERJID VARCHAR );
CREATE TABLE ZWAGROUPMEMBER ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZCONTACTABID INTEGER, ZISACTIVE INTEGER, ZISADMIN INTEGER, ZSENDERKEYSENT INTEGER, ZCHATSESSION INTEGER, ZRECENTGROUPCHAT INTEGER, ZCONTACTIDENTIFIER VARCHAR, ZCONTACTNAME VARCHAR, ZFIRSTNAME VARCHAR, ZMEMBERJID VARCHAR );
CREATE TABLE ZWAGROUPMEMBERSCHANGE ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZCHANGETYPE INTEGER, ZCHANGEDATE TIMESTAMP, ZGROUPJID VARCHAR, ZMEMBERJIDS VARCHAR, ZPHASHBEFORECHANGE VARCHAR );
CREATE TABLE ZWAMEDIAITEM ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZCLOUDSTATUS INTEGER, ZFILESIZE INTEGER, ZMEDIAORIGIN INTEGER, ZMOVIEDURATION INTEGER, ZMESSAGE INTEGER, ZASPECTRATIO FLOAT, ZHACCURACY FLOAT, ZLATITUDE FLOAT, ZLONGITUDE FLOAT, ZMEDIAURLDATE TIMESTAMP, ZAUTHORNAME VARCHAR, ZCOLLECTIONNAME VARCHAR, ZMEDIALOCALPATH VARCHAR, ZMEDIAURL VARCHAR, ZTHUMBNAILLOCALPATH VARCHAR, ZTITLE VARCHAR, ZVCARDNAME VARCHAR, ZVCARDSTRING VARCHAR, ZXMPPTHUMBPATH VARCHAR, ZMEDIAKEY BLOB, ZMETADATA BLOB );
CREATE TABLE ZWAMESSAGE ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZCHILDMESSAGESDELIVEREDCOUNT INTEGER, ZCHILDMESSAGESPLAYEDCOUNT INTEGER, ZCHILDMESSAGESREADCOUNT INTEGER, ZDATAITEMVERSION INTEGER, ZDOCID INTEGER, ZENCRETRYCOUNT INTEGER, ZFILTEREDRECIPIENTCOUNT INTEGER, ZFLAGS INTEGER, ZGROUPEVENTTYPE INTEGER, ZISFROMME INTEGER, ZMESSAGEERRORSTATUS INTEGER, ZMESSAGESTATUS INTEGER, ZMESSAGETYPE INTEGER, ZSORT INTEGER, ZSPOTLIGHTSTATUS INTEGER, ZSTARRED INTEGER, ZCHATSESSION INTEGER, ZGROUPMEMBER INTEGER, ZLASTSESSION INTEGER, ZMEDIAITEM INTEGER, ZMESSAGEINFO INTEGER, ZPARENTMESSAGE INTEGER, ZMESSAGEDATE TIMESTAMP, ZSENTDATE TIMESTAMP, ZFROMJID VARCHAR, ZMEDIASECTIONID VARCHAR, ZPHASH VARCHAR, ZPUSHNAME VARCHAR, ZSTANZAID VARCHAR, ZTEXT VARCHAR, ZTOJID VARCHAR );
CREATE TABLE ZWAMESSAGEDATAITEM ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZINDEX INTEGER, ZOWNSTHUMBNAIL INTEGER, ZTYPE INTEGER, ZMESSAGE INTEGER, ZDATE TIMESTAMP, ZCHATJID VARCHAR, ZCONTENT1 VARCHAR, ZCONTENT2 VARCHAR, ZMATCHEDTEXT VARCHAR, ZSECTIONID VARCHAR, ZSENDERJID VARCHAR, ZSUMMARY VARCHAR, ZTHUMBNAILPATH VARCHAR, ZTITLE VARCHAR );
CREATE TABLE ZWAMESSAGEINFO ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZMESSAGE INTEGER, ZRECEIPTINFO BLOB );
CREATE TABLE ZWAPROFILEPICTUREITEM ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZREQUESTDATE TIMESTAMP, ZJID VARCHAR, ZPATH VARCHAR, ZPICTUREID VARCHAR );
CREATE TABLE ZWAPROFILEPUSHNAME ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZJID VARCHAR, ZPUSHNAME VARCHAR );
CREATE TABLE ZWAVCARDMENTION ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZISFROMME INTEGER, ZTRUSTEDWHENINDEXED INTEGER, ZMEDIAITEM INTEGER, ZDATE TIMESTAMP, ZSENDERJID VARCHAR, ZWHATSAPPID VARCHAR );
CREATE TABLE Z_METADATA (Z_VERSION INTEGER PRIMARY KEY, Z_UUID VARCHAR(255), Z_PLIST BLOB);
CREATE TABLE Z_MODELCACHE (Z_CONTENT BLOB);
CREATE TABLE ZWAZ1PAYMENTTRANSACTION ( Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER, Z_OPT INTEGER, ZAMOUNT_1000 INTEGER, ZSTATUS INTEGER, ZTYPE INTEGER, ZTIMESTAMP TIMESTAMP, ZBANKTRANSACTIONID VARCHAR, ZCREDENTIALID VARCHAR, ZCURRENCY VARCHAR, ZERRORCODE VARCHAR, ZGROUPJID VARCHAR, ZMESSAGESTANZAID VARCHAR, ZRECEIVERJID VARCHAR, ZSENDERJID VARCHAR, ZTRANSACTIONID VARCHAR, ZMETADATA BLOB );
CREATE TABLE Z_PRIMARYKEY (Z_ENT INTEGER PRIMARY KEY, Z_NAME VARCHAR, Z_SUPER INTEGER, Z_MAX INTEGER);
CREATE INDEX ZWACHATPROPERTIES_ZCHATSESSION_INDEX ON ZWACHATPROPERTIES (ZCHATSESSION);
CREATE INDEX ZWACHATSESSION_ZGROUPINFO_INDEX ON ZWACHATSESSION (ZGROUPINFO);
CREATE INDEX ZWACHATSESSION_ZLASTMESSAGE_INDEX ON ZWACHATSESSION (ZLASTMESSAGE);
CREATE INDEX ZWACHATSESSION_ZPROPERTIES_INDEX ON ZWACHATSESSION (ZPROPERTIES);
CREATE INDEX ZWAGROUPINFO_ZCHATSESSION_INDEX ON ZWAGROUPINFO (ZCHATSESSION);
CREATE INDEX ZWAGROUPINFO_ZLASTMESSAGEOWNER_INDEX ON ZWAGROUPINFO (ZLASTMESSAGEOWNER);
CREATE INDEX ZWAGROUPMEMBER_ZCHATSESSION_INDEX ON ZWAGROUPMEMBER (ZCHATSESSION);
CREATE INDEX ZWAGROUPMEMBER_ZRECENTGROUPCHAT_INDEX ON ZWAGROUPMEMBER (ZRECENTGROUPCHAT);
CREATE INDEX ZWAMEDIAITEM_ZMESSAGE_INDEX ON ZWAMEDIAITEM (ZMESSAGE);
CREATE INDEX ZWAMESSAGE_ZCHATSESSION_INDEX ON ZWAMESSAGE (ZCHATSESSION);
CREATE INDEX ZWAMESSAGE_ZGROUPMEMBER_INDEX ON ZWAMESSAGE (ZGROUPMEMBER);
CREATE INDEX ZWAMESSAGE_ZLASTSESSION_INDEX ON ZWAMESSAGE (ZLASTSESSION);
CREATE INDEX ZWAMESSAGE_ZMEDIAITEM_INDEX ON ZWAMESSAGE (ZMEDIAITEM);
CREATE INDEX ZWAMESSAGE_ZMESSAGEINFO_INDEX ON ZWAMESSAGE (ZMESSAGEINFO);
CREATE INDEX ZWAMESSAGE_ZPARENTMESSAGE_INDEX ON ZWAMESSAGE (ZPARENTMESSAGE);
CREATE INDEX ZWAMESSAGE_ZCHATSESSION_ZSORT ON ZWAMESSAGE (ZCHATSESSION, ZSORT);
CREATE INDEX ZWAMESSAGE_ZCHATSESSION_ZMEDIASECTIONID_ZSORT ON ZWAMESSAGE (ZCHATSESSION, ZMEDIASECTIONID, ZSORT);
CREATE INDEX ZWAMESSAGE_ZCHATSESSION_ZSTARRED_ZMESSAGEDATE ON ZWAMESSAGE (ZCHATSESSION, ZSTARRED, ZMESSAGEDATE);
CREATE INDEX ZWAMESSAGEDATAITEM_ZMESSAGE_INDEX ON ZWAMESSAGEDATAITEM (ZMESSAGE);
CREATE INDEX ZWAMESSAGEINFO_ZMESSAGE_INDEX ON ZWAMESSAGEINFO (ZMESSAGE);
CREATE INDEX ZWAVCARDMENTION_ZMEDIAITEM_INDEX ON ZWAVCARDMENTION (ZMEDIAITEM);
CREATE INDEX Z_WAChatSession_contactJID ON ZWACHATSESSION (ZCONTACTJID COLLATE BINARY ASC);
CREATE INDEX Z_WAChatSession_identityVerificationEpoch ON ZWACHATSESSION (ZIDENTITYVERIFICATIONEPOCH COLLATE BINARY ASC);
CREATE INDEX Z_WAChatSession_identityVerificationState ON ZWACHATSESSION (ZIDENTITYVERIFICATIONSTATE COLLATE BINARY ASC);
CREATE INDEX Z_WAChatSession_lastMessageDate ON ZWACHATSESSION (ZLASTMESSAGEDATE COLLATE BINARY ASC);
CREATE INDEX Z_WAChatSession_removed ON ZWACHATSESSION (ZREMOVED COLLATE BINARY ASC);
CREATE INDEX Z_WAChatSession_sessionType ON ZWACHATSESSION (ZSESSIONTYPE COLLATE BINARY ASC);
CREATE INDEX Z_WAChatSession_spotlightStatus ON ZWACHATSESSION (ZSPOTLIGHTSTATUS COLLATE BINARY ASC);
CREATE INDEX Z_WAGroupMember_memberJID ON ZWAGROUPMEMBER (ZMEMBERJID COLLATE BINARY ASC);
CREATE INDEX Z_WAGroupMembersChange_changeDate ON ZWAGROUPMEMBERSCHANGE (ZCHANGEDATE COLLATE BINARY ASC);
CREATE INDEX Z_WAGroupMembersChange_changeType ON ZWAGROUPMEMBERSCHANGE (ZCHANGETYPE COLLATE BINARY ASC);
CREATE INDEX Z_WAGroupMembersChange_groupJID ON ZWAGROUPMEMBERSCHANGE (ZGROUPJID COLLATE BINARY ASC);
CREATE INDEX Z_WAMediaItem_cloudStatus ON ZWAMEDIAITEM (ZCLOUDSTATUS COLLATE BINARY ASC);
CREATE INDEX Z_WAMediaItem_vCardName ON ZWAMEDIAITEM (ZVCARDNAME COLLATE BINARY ASC);
CREATE INDEX Z_WAMessage_dataItemVersion_messageDate ON ZWAMESSAGE (ZDATAITEMVERSION COLLATE BINARY ASC, ZMESSAGEDATE COLLATE BINARY ASC);
CREATE INDEX Z_WAMessage_docID ON ZWAMESSAGE (ZDOCID COLLATE BINARY ASC);
CREATE INDEX Z_WAMessage_messageDate ON ZWAMESSAGE (ZMESSAGEDATE COLLATE BINARY ASC);
CREATE INDEX Z_WAMessage_messageErrorStatus ON ZWAMESSAGE (ZMESSAGEERRORSTATUS COLLATE BINARY ASC);
CREATE INDEX Z_WAMessage_messageStatus ON ZWAMESSAGE (ZMESSAGESTATUS COLLATE BINARY ASC);
CREATE INDEX Z_WAMessage_messageType ON ZWAMESSAGE (ZMESSAGETYPE COLLATE BINARY ASC);
CREATE INDEX Z_WAMessage_sort ON ZWAMESSAGE (ZSORT COLLATE BINARY ASC);
CREATE INDEX Z_WAMessage_spotlightStatus_messageDate ON ZWAMESSAGE (ZSPOTLIGHTSTATUS COLLATE BINARY ASC, ZMESSAGEDATE COLLATE BINARY ASC);
CREATE INDEX Z_WAMessage_stanzaID ON ZWAMESSAGE (ZSTANZAID COLLATE BINARY ASC);
CREATE INDEX Z_WAMessage_starred ON ZWAMESSAGE (ZSTARRED COLLATE BINARY ASC);
CREATE INDEX Z_WAMessageDataItem_chatJID_type_sectionID_date ON ZWAMESSAGEDATAITEM (ZCHATJID COLLATE BINARY ASC, ZTYPE COLLATE BINARY ASC, ZSECTIONID COLLATE BINARY ASC, ZDATE COLLATE BINARY ASC);
CREATE INDEX Z_WAMessageDataItem_senderJID_type_sectionID_date ON ZWAMESSAGEDATAITEM (ZSENDERJID COLLATE BINARY ASC, ZTYPE COLLATE BINARY ASC, ZSECTIONID COLLATE BINARY ASC, ZDATE COLLATE BINARY ASC);
CREATE INDEX Z_WAProfilePictureItem_jid ON ZWAPROFILEPICTUREITEM (ZJID COLLATE BINARY ASC);
CREATE INDEX Z_WAProfilePushName_jid ON ZWAPROFILEPUSHNAME (ZJID COLLATE BINARY ASC);
CREATE INDEX Z_WAVCardMention_date ON ZWAVCARDMENTION (ZDATE COLLATE BINARY ASC);
CREATE INDEX Z_WAVCardMention_whatsAppID ON ZWAVCARDMENTION (ZWHATSAPPID COLLATE BINARY ASC);
CREATE INDEX Z_WAZ1PaymentTransaction_credentialId ON ZWAZ1PAYMENTTRANSACTION (ZCREDENTIALID COLLATE BINARY ASC);
CREATE INDEX Z_WAZ1PaymentTransaction_messageStanzaId ON ZWAZ1PAYMENTTRANSACTION (ZMESSAGESTANZAID COLLATE BINARY ASC);
CREATE INDEX Z_WAZ1PaymentTransaction_status ON ZWAZ1PAYMENTTRANSACTION (ZSTATUS COLLATE BINARY ASC);
CREATE INDEX Z_WAZ1PaymentTransaction_transactionId ON ZWAZ1PAYMENTTRANSACTION (ZTRANSACTIONID COLLATE BINARY ASC);
CREATE INDEX Z_WAZ1PaymentTransaction_type ON ZWAZ1PAYMENTTRANSACTION (ZTYPE COLLATE BINARY ASC);
CREATE INDEX Z_WAZ1PaymentTransaction_type_status ON ZWAZ1PAYMENTTRANSACTION (ZTYPE COLLATE BINARY ASC, ZSTATUS COLLATE BINARY ASC);
