root@server20:~/s390-tests/tests# sqlite3 /tmp/accounts.db
SQLite version 3.9.2 2015-11-02 18:31:45
Enter ".help" for usage hints.
sqlite> .dump
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE Accounts (id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT,provider TEXT,enabled INTEGER);
INSERT INTO "Accounts" VALUES(1,'My test account','maemo',1);
INSERT INTO "Accounts" VALUES(2,'My test account','maemo',0);
INSERT INTO "Accounts" VALUES(3,'My test account','maemo',1);
CREATE TABLE Services (id INTEGER PRIMARY KEY AUTOINCREMENT,name TEXT NOT NULL UNIQUE,display TEXT NOT NULL,provider TEXT,type TEXT);
INSERT INTO "Services" VALUES(1,'MyService','My Service','maemo','e-mail');
INSERT INTO "Services" VALUES(2,'MyService2','My Service #2','maemo','calendar');
INSERT INTO "Services" VALUES(3,'OtherService','Other Service','other_provider','sharing');
CREATE TABLE Settings (account INTEGER NOT NULL,service INTEGER,key TEXT NOT NULL,type TEXT NOT NULL,value BLOB);
INSERT INTO "Settings" VALUES(1,0,'enabled','b','true');
INSERT INTO "Settings" VALUES(1,0,'name','s','''My test account''');
INSERT INTO "Settings" VALUES(2,0,'name','s','''My test account''');
INSERT INTO "Settings" VALUES(3,0,'enabled','b','true');
INSERT INTO "Settings" VALUES(3,0,'name','s','''My test account''');
INSERT INTO "Settings" VALUES(1,1,'enabled','b','true');
INSERT INTO "Settings" VALUES(1,2,'enabled','b','false');
INSERT INTO "Settings" VALUES(2,1,'enabled','b','true');
INSERT INTO "Settings" VALUES(2,0,'enabled','b','false');
INSERT INTO "Settings" VALUES(2,2,'enabled','b','false');
INSERT INTO "Settings" VALUES(3,1,'enabled','b','false');
INSERT INTO "Settings" VALUES(3,2,'enabled','b','true');
CREATE TABLE Signatures (account INTEGER NOT NULL,service INTEGER,key TEXT NOT NULL,signature TEXT NOT NULL,token TEXT NOT NULL);
DELETE FROM sqlite_sequence;
INSERT INTO "sqlite_sequence" VALUES('Accounts',3);
INSERT INTO "sqlite_sequence" VALUES('Services',3);
CREATE INDEX idx_service ON Services(name);
CREATE UNIQUE INDEX idx_setting ON Settings (account, service, key);
CREATE TRIGGER tg_delete_account BEFORE DELETE ON Accounts FOR EACH ROW BEGIN DELETE FROM Settings WHERE account = OLD.id; END;
CREATE UNIQUE INDEX idx_signatures ON Signatures (account, service, key);
COMMIT;