CREATE TABLE if not exists capability (_id INTEGER PRIMARY KEY AUTOINCREMENT, key TEXT, value INTEGER,
package_name TEXT, user_name TEXT, account_id INTEGER, FOREIGN KEY (account_id) REFERENCES account(_id));
CREATE TABLE if not exists provider_feature (app_id TEXT, key TEXT);
+ CREATE TABLE if not exists deleted_account (_id INTEGER, user_name TEXT, email_address TEXT, display_name TEXT, icon_path TEXT, source TEXT,
+ package_name TEXT, access_token TEXT, domain_name TEXT, auth_type INTEGER, secret INTEGER, sync_support INTEGER, txt_custom0 TEXT, txt_custom1 TEXT,
+ txt_custom2 TEXT, txt_custom3 TEXT, txt_custom4 TEXT, int_custom0 INTEGER, int_custom1 INTEGER, int_custom2 INTEGER, int_custom3 INTEGER, int_custom4 INTEGER);
+ CREATE TABLE if not exists deleted_capability (_id INTEGER, key TEXT, value INTEGER, package_name TEXT, user_name TEXT, account_id INTEGER);
+ CREATE TABLE if not exists deleted_account_custom (AccountId INTEGER, AppId TEXT, Key TEXT, Value TEXT);
+ CREATE TRIGGER if not exists aft_acc_del AFTER DELETE ON account BEGIN INSERT INTO deleted_account VALUES (old._id, old.user_name, old.email_address,
+ old.display_name, old.icon_path, old.source, old.package_name, old.access_token, old.domain_name, old.auth_type, old.secret, old.sync_support,
+ old.txt_custom0, old.txt_custom1, old.txt_custom2, old.txt_custom3, old.txt_custom4, old.int_custom0, old.int_custom1, old.int_custom2,
+ old.int_custom3, old.int_custom4); END;
+ CREATE TRIGGER if not exists aft_capa_del AFTER DELETE ON capability BEGIN INSERT INTO deleted_capability VALUES (old._id, old.key, old.value, old.package_name,
+ old.user_name, old.account_id); END;
+ CREATE TRIGGER if not exists aft_cust_del AFTER DELETE ON account_custom BEGIN INSERT INTO deleted_account_custom VALUES (old.AccountId, old.AppId,
+ old.Key, old.Value); END;
'
fi