~aleteoryx/muditaos

ee8a5e4ab977e24e0ffc93d3e8681f9a426e714a — Tomek Sobkowiak 5 years ago a69fb53
[EDG-4346] Load script to init contacts database (#1013)

D image/user/contacts.db => image/user/contacts.db +0 -0
A image/user/db/contacts_001.sql => image/user/db/contacts_001.sql +79 -0
@@ 0,0 1,79 @@
CREATE TABLE IF NOT EXISTS contacts
(
    _id        INTEGER PRIMARY KEY,
    name_id    INTEGER,
    numbers_id TEXT NOT NULL,
    ring_id    INTEGER,
    address_id INTEGER,
    speeddial  TEXT NOT NULL,
    FOREIGN KEY (name_id) REFERENCES contact_name (_id),
    FOREIGN KEY (ring_id) REFERENCES contact_ringtones (_id)
);

CREATE TABLE IF NOT EXISTS contact_address
(
    _id        INTEGER PRIMARY KEY,
    contact_id INTEGER,
    address    TEXT NOT NULL,
    note       TEXT NOT NULL,
    mail       TEXT NOT NULL,
    FOREIGN KEY (contact_id) REFERENCES contacts (_id)
);

CREATE TABLE IF NOT EXISTS contact_groups
(
    _id  INTEGER PRIMARY KEY,
    name TEXT NOT NULL UNIQUE
);

CREATE TABLE IF NOT EXISTS contact_match_groups
(
    _id        INTEGER PRIMARY KEY,
    group_id   INTEGER,
    contact_id INTEGER,
    FOREIGN KEY (group_id) REFERENCES contact_groups (_id)
        ON DELETE CASCADE,
    FOREIGN KEY (contact_id) REFERENCES contacts (_id)
        ON DELETE CASCADE,
    CONSTRAINT unique_group_contact
        UNIQUE (group_id, contact_id)
);

CREATE TABLE IF NOT EXISTS contact_group_protected
(
    _id      INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
    group_id INTEGER NOT NULL UNIQUE
);

CREATE TABLE IF NOT EXISTS contact_name
(
    _id              INTEGER PRIMARY KEY,
    contact_id       INTEGER,
    name_primary     TEXT NOT NULL,
    name_alternative TEXT NOT NULL,
    FOREIGN KEY (contact_id) REFERENCES contacts (_id)
);

CREATE TABLE IF NOT EXISTS contact_number
(
    _id         INTEGER PRIMARY KEY,
    contact_id  INTEGER,
    number_user TEXT NOT NULL,
    number_e164 TEXT NOT NULL,
    type        INTEGER,
    FOREIGN KEY (contact_id) REFERENCES contacts (_id)
);

CREATE TABLE IF NOT EXISTS contact_ringtones
(
    _id        INTEGER PRIMARY KEY,
    contact_id INTEGER,
    asset_path TEXT NOT NULL,
    FOREIGN KEY (contact_id) REFERENCES contacts (_id) ON DELETE CASCADE
);

CREATE INDEX IF NOT EXISTS contact_match_group_index_on_group
    ON contact_match_groups (group_id);
CREATE INDEX IF NOT EXISTS contact_match_group_index_on_contact
    ON contact_match_groups (contact_id);


A image/user/db/contacts_002.sql => image/user/db/contacts_002.sql +13 -0
@@ 0,0 1,13 @@
INSERT OR REPLACE INTO contact_group_protected
    (_id, group_id)
VALUES (1, 1),
       (2, 2),
       (3, 3),
       (4, 4);

INSERT OR REPLACE INTO contact_groups
    (_id, name)
VALUES (1, 'Favourites'),
       (2, 'ICE'),
       (3, 'Blocked'),
       (4, 'Temporary');

A image/user/db/contacts_003.sql => image/user/db/contacts_003.sql +512 -0
@@ 0,0 1,512 @@
BEGIN;
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (1,1,'1',1,1,1);
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (2,2,'2',2,2,2);
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (3,3,'3',3,3,3);
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (4,4,'4',4,4,4);
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (5,5,'5',5,5,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (6,6,'6',6,6,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (7,7,'7',7,7,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (8,8,'8',8,8,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (9,9,'9',9,9,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (10,10,'10',10,10,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (11,11,'11',11,11,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (12,12,'12',12,12,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (13,13,'13',13,13,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (14,14,'14',14,14,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (15,15,'15',15,15,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (16,16,'16',16,16,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (17,17,'17',17,17,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (18,18,'18',18,18,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (19,19,'19',19,19,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (20,20,'20',20,20,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (21,21,'21',21,21,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (22,22,'22',22,22,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (23,23,'23',23,23,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (24,24,'24',24,24,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (25,25,'25',25,25,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (26,26,'26',26,26,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (27,27,'27',27,27,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (28,28,'28',28,28,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (29,29,'29',29,29,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (30,30,'30',30,30,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (31,31,'31',31,31,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (32,32,'32',32,32,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (33,33,'33',33,33,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (34,34,'34',34,34,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (35,35,'35',35,35,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (36,36,'36',36,36,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (37,37,'37',37,37,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (38,38,'38',38,38,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (39,39,'39',39,39,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (40,40,'40',40,40,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (41,41,'41',41,41,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (42,42,'42',42,42,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (43,43,'43',43,43,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (44,44,'44',44,44,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (45,45,'45',45,45,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (46,46,'46',46,46,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (47,47,'47',47,47,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (48,48,'48',48,48,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (49,49,'49',49,49,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (50,50,'50',50,50,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (51,51,'51',51,51,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (52,52,'52',52,52,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (53,53,'53',53,53,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (54,54,'54',54,54,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (55,55,'55',55,55,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (56,56,'56',56,56,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (57,57,'57',57,57,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (58,58,'58',58,58,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (59,59,'59',59,59,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (60,60,'60',60,60,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (61,61,'61',61,61,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (62,62,'62',62,62,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (63,63,'63',63,63,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (64,64,'64',64,64,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (65,65,'65',65,65,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (66,66,'66',66,66,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (67,67,'67',67,67,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (68,68,'68',68,68,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (69,69,'69',69,69,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (70,70,'70',70,70,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (71,71,'71',71,71,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (72,72,'72',72,72,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (73,73,'73',73,73,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (74,74,'74',74,74,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (75,75,'75',75,75,'');
INSERT OR REPLACE INTO  contacts (_id,name_id,numbers_id,ring_id,address_id,speeddial) VALUES (76,76,'76',76,76,'');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (1,1,'Alek','Wyczesany');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (2,2,'Zofia','Wyczesany');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (3,3,'Cezary','Wyczesany');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (4,4,'Alek','Arbuz');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (5,5,'Zofia','Pacha');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (6,6,'Roland','Pacha');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (7,7,'Cezary','Pacha');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (8,8,'Ignacy','Pacha');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (9,9,'Ejdiran','Pacha');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (10,10,'Sebastian','Pacha');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (11,11,'Mariola','Pacha');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (12,12,'Mateusz','Pacha');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (13,13,'Alek','Małolepszy');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (14,14,'Roland','Małolepszy');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (15,15,'Cezary','Małolepszy');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (16,16,'Ignacy','Małolepszy');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (17,17,'Grażyna','Małolepszy');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (18,18,'Mariola','Małolepszy');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (19,19,'Alek','Boligłowa');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (20,20,'Zofia','Boligłowa');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (21,21,'Cezary','Boligłowa');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (22,22,'Grażyna','Boligłowa');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (23,23,'Alek','Kiełbasa');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (24,24,'Zofia','Kiełbasa');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (25,25,'Alek','Ściera');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (26,26,'Zofia','Ściera');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (27,27,'Cezary','Ściera');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (28,28,'Ejdiran','Ściera');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (29,29,'Sebastian','Ściera');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (30,30,'Ola','Ściera');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (31,31,'Alek','Słaby');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (32,32,'Roland','Słaby');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (33,33,'Ejdiran','Słaby');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (34,34,'Grażyna','Słaby');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (35,35,'Alek','Cnotliwy');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (36,36,'Janusz','Cnotliwy');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (37,37,'Ignacy','Cnotliwy');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (38,38,'Ejdiran','Cnotliwy');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (39,39,'Karyna','Cnotliwy');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (40,40,'Alek','Bubel');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (41,41,'Zofia','Bubel');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (42,42,'Roland','Bubel');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (43,43,'Cezary','Bubel');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (44,44,'Brian','Bubel');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (45,45,'Ejdiran','Bubel');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (46,46,'Grażyna','Bubel');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (47,47,'Sebastian','Bubel');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (48,48,'Mariola','Bubel');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (49,49,'Alek','Fundament');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (50,50,'Roland','Fundament');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (51,51,'Ignacy','Fundament');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (52,52,'Alek','Rura');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (53,53,'Zofia','Rura');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (54,54,'Cezary','Rura');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (55,55,'Ignacy','Rura');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (56,56,'Ejdiran','Rura');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (57,57,'Sebastian','Rura');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (58,58,'Karyna','Rura');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (59,59,'Ola','Rura');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (60,60,'Alek','Bucior');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (61,61,'Roland','Bucior');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (62,62,'Brian','Bucior');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (63,63,'Grażyna','Bucior');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (64,64,'Sebastian','Bucior');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (65,65,'Ola','Bucior');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (66,66,'Alek','Kusibab');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (67,67,'Roland','Kusibab');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (68,68,'Cezary','Kusibab');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (69,69,'Brian','Kusibab');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (70,70,'Grażyna','Kusibab');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (71,71,'Alek','Kwasigroch');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (72,72,'Janusz','Kwasigroch');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (73,73,'Roland','Kwasigroch');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (74,74,'Ignacy','Kwasigroch');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (75,75,'Alek','Siekierka');
INSERT OR REPLACE INTO  contact_name (_id,contact_id,name_primary,name_alternative) VALUES (76,76,'Ejdiran','Siekierka');
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (1,1,1);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (2,2,2);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (3,1,3);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (4,1,4);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (5,2,5);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (6,2,6);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (7,1,7);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (8,2,8);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (9,2,9);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (10,2,10);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (11,1,11);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (12,1,12);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (13,1,13);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (14,2,14);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (15,1,15);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (16,2,15);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (17,2,16);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (18,2,17);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (19,1,18);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (20,1,19);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (21,1,20);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (22,3,21);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (23,1,22);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (24,1,23);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (25,2,23);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (26,3,23);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (27,2,24);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (28,2,25);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (29,2,26);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (30,1,28);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (31,1,30);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (32,1,34);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (33,1,35);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (34,1,39);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (35,1,42);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (36,1,43);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (37,1,44);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (38,3,45);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (39,1,46);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (40,1,47);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (41,1,49);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (42,1,50);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (43,1,52);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (44,1,54);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (45,1,56);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (46,1,61);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (47,1,63);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (48,1,64);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (49,1,65);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (50,1,66);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (51,1,67);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (52,1,73);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (53,1,75);
INSERT OR REPLACE INTO  contact_match_groups (_id,group_id,contact_id) VALUES (54,1,76);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (1,1,'500675127','+48500675127',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (2,2,'500528016','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (3,3,'500430874','+48500430874',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (4,4,'500466048','+48500466048',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (5,5,'500281761','+48500281761',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (6,6,'500228417','+48500228417',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (7,7,'500962623','+48500962623',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (8,8,'500920240','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (9,9,'500172687','+48500172687',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (10,10,'500382882','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (11,11,'500224669','+48500224669',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (12,12,'500302052','+48500302052',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (13,13,'500011043','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (14,14,'500278093','+48500278093',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (15,15,'500276552','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (16,16,'500595838','+48500595838',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (17,17,'500106818','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (18,18,'500656267','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (19,19,'500639802','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (20,20,'500545546','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (21,21,'500384106','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (22,22,'500453837','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (23,23,'500209669','+48500209669',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (24,24,'500111026','+48500111026',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (25,25,'500153618','+48500153618',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (26,26,'500922529','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (27,27,'500864199','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (28,28,'500072634','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (29,29,'500184705','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (30,30,'500432822','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (31,31,'500107112','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (32,32,'500654760','+48500654760',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (33,33,'500366054','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (34,34,'500417554','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (35,35,'500343578','+48500343578',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (36,36,'500234711','+48500234711',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (37,37,'500792842','+48500792842',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (38,38,'500086809','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (39,39,'500171084','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (40,40,'500680904','+48500680904',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (41,41,'500589909','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (42,42,'500701411','+48500701411',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (43,43,'500656981','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (44,44,'500087699','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (45,45,'500174454','+48500174454',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (46,46,'500407536','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (47,47,'500554852','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (48,48,'500092674','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (49,49,'500674747','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (50,50,'500971047','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (51,51,'500022902','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (52,52,'500911742','+48500911742',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (53,53,'500041122','+48500041122',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (54,54,'500324845','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (55,55,'500395618','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (56,56,'500434388','+48500434388',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (57,57,'500255513','+48500255513',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (58,58,'500737617','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (59,59,'500792522','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (60,60,'500162505','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (61,61,'500784138','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (62,62,'500114082','+48500114082',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (63,63,'500047913','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (64,64,'500720468','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (65,65,'500148059','+48500148059',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (66,66,'500106783','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (67,67,'500096337','+48500096337',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (68,68,'500064275','+48500064275',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (69,69,'500144150','+48500144150',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (70,70,'500281243','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (71,71,'500027153','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (72,72,'500096224','+48500096224',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (73,73,'500618547','+48500618547',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (74,74,'500627536','',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (75,75,'500732979','+48500732979',0);
INSERT OR REPLACE INTO  contact_number (_id,contact_id,number_user,number_e164,type) VALUES (76,76,'500254402','',0);
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (1,1,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (2,2,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (3,3,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (4,4,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (5,5,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (6,6,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (7,7,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (8,8,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (9,9,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (10,10,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (11,11,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (12,12,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (13,13,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (14,14,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (15,15,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (16,16,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (17,17,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (18,18,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (19,19,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (20,20,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (21,21,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (22,22,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (23,23,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (24,24,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (25,25,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (26,26,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (27,27,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (28,28,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (29,29,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (30,30,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (31,31,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (32,32,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (33,33,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (34,34,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (35,35,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (36,36,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (37,37,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (38,38,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (39,39,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (40,40,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (41,41,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (42,42,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (43,43,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (44,44,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (45,45,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (46,46,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (47,47,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (48,48,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (49,49,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (50,50,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (51,51,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (52,52,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (53,53,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (54,54,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (55,55,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (56,56,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (57,57,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (58,58,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (59,59,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (60,60,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (61,61,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (62,62,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (63,63,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (64,64,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (65,65,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (66,66,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (67,67,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (68,68,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (69,69,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (70,70,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (71,71,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (72,72,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (73,73,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (74,74,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (75,75,'');
INSERT OR REPLACE INTO  contact_ringtones (_id,contact_id,asset_path) VALUES (76,76,'');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (1,1,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Alek.Wyczesany@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (2,2,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Zofia.Wyczesany@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (3,3,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Cezary.Wyczesany@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (4,4,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Alek.Pacha@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (5,5,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Zofia.Pacha@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (6,6,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Roland.Pacha@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (7,7,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Cezary.Pacha@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (8,8,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Ignacy.Pacha@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (9,9,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Ejdiran.Pacha@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (10,10,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Sebastian.Pacha@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (11,11,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Mariola.Pacha@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (12,12,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Mateusz.Pacha@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (13,13,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Alek.Małolepszy@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (14,14,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Roland.Małolepszy@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (15,15,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Cezary.Małolepszy@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (16,16,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Ignacy.Małolepszy@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (17,17,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Grażyna.Małolepszy@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (18,18,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Mariola.Małolepszy@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (19,19,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Alek.Boligłowa@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (20,20,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Zofia.Boligłowa@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (21,21,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Cezary.Boligłowa@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (22,22,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Grażyna.Boligłowa@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (23,23,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Alek.Kiełbasa@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (24,24,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Zofia.Kiełbasa@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (25,25,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Alek.Ściera@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (26,26,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Zofia.Ściera@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (27,27,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Cezary.Ściera@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (28,28,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Ejdiran.Ściera@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (29,29,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Sebastian.Ściera@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (30,30,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Ola.Ściera@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (31,31,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Alek.Słaby@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (32,32,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Roland.Słaby@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (33,33,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Ejdiran.Słaby@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (34,34,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Grażyna.Słaby@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (35,35,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Alek.Cnotliwy@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (36,36,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Janusz.Cnotliwy@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (37,37,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Ignacy.Cnotliwy@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (38,38,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Ejdiran.Cnotliwy@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (39,39,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Karyna.Cnotliwy@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (40,40,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Alek.Bubel@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (41,41,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Zofia.Bubel@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (42,42,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Roland.Bubel@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (43,43,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Cezary.Bubel@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (44,44,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Brian.Bubel@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (45,45,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Ejdiran.Bubel@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (46,46,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Grażyna.Bubel@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (47,47,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Sebastian.Bubel@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (48,48,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Mariola.Bubel@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (49,49,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Alek.Fundament@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (50,50,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Roland.Fundament@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (51,51,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Ignacy.Fundament@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (52,52,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Alek.Rura@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (53,53,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Zofia.Rura@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (54,54,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Cezary.Rura@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (55,55,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Ignacy.Rura@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (56,56,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Ejdiran.Rura@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (57,57,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Sebastian.Rura@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (58,58,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Karyna.Rura@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (59,59,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Ola.Rura@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (60,60,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Alek.Bucior@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (61,61,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Roland.Bucior@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (62,62,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Brian.Bucior@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (63,63,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Grażyna.Bucior@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (64,64,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Sebastian.Bucior@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (65,65,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Ola.Bucior@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (66,66,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Alek.Kusibab@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (67,67,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Roland.Kusibab@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (68,68,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Cezary.Kusibab@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (69,69,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Brian.Kusibab@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (70,70,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Grażyna.Kusibab@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (71,71,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Alek.Kwasigroch@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (72,72,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Janusz.Kwasigroch@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (73,73,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Roland.Kwasigroch@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (74,74,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Ignacy.Kwasigroch@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (75,75,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Alek.Siekierka@mudita.com');
INSERT OR REPLACE INTO  contact_address (_id,contact_id,address,note,mail) VALUES (76,76,'6 Czeczota St.
02600 Warsaw','This is interesting note. More information is needed in this note.','Ejdiran.Siekierka@mudita.com');
COMMIT;

M module-db/Database/DatabaseInitializer.hpp => module-db/Database/DatabaseInitializer.hpp +1 -1
@@ 36,7 36,7 @@ class DatabaseInitializer
            vfs.fclose(file);
        }

        [[nodiscard]] auto get() const -> vfs::FILE *
        [[nodiscard]] vfs::FILE *get() const
        {
            return file;
        }

M module-db/Databases/ContactsDB.cpp => module-db/Databases/ContactsDB.cpp +0 -24
@@ 15,25 15,6 @@ ContactsDB::ContactsDB()
    : Database(dbName), contacts(this), name(this), number(this), ringtones(this), address(this), groups(this)
{

    if (contacts.create() == false) {
        return;
    }
    if (name.create() == false) {
        return;
    }
    if (number.create() == false) {
        return;
    }
    if (ringtones.create() == false) {
        return;
    }
    if (address.create() == false) {
        return;
    }
    if (groups.create() == false) {
        return;
    }

    if (favouritesId == 0) {
        favouritesId = groups.favouritesId();
    }


@@ 46,9 27,4 @@ ContactsDB::ContactsDB()
    if (temporaryId == 0) {
        temporaryId = groups.temporaryId();
    }

    isInitialized_ = true;
}

ContactsDB::~ContactsDB()
{}

M module-db/Databases/ContactsDB.hpp => module-db/Databases/ContactsDB.hpp +1 -1
@@ 15,7 15,7 @@ class ContactsDB : public Database
{
  public:
    ContactsDB();
    ~ContactsDB();
    ~ContactsDB() = default;

    static const char *GetDBName()
    {

M module-db/Tables/ContactsAddressTable.cpp => module-db/Tables/ContactsAddressTable.cpp +1 -1
@@ 11,7 11,7 @@ ContactsAddressTable::~ContactsAddressTable()

bool ContactsAddressTable::create()
{
    return db->execute(createTableQuery);
    return true;
}

bool ContactsAddressTable::add(ContactsAddressTableRow entry)

M module-db/Tables/ContactsAddressTable.hpp => module-db/Tables/ContactsAddressTable.hpp +0 -8
@@ 49,12 49,4 @@ class ContactsAddressTable : public Table<ContactsAddressTableRow, ContactAddres
    uint32_t countByFieldId(const char *field, uint32_t id) override final;

  private:
    const char *createTableQuery = "CREATE TABLE IF NOT EXISTS contact_address("
                                   "_id              INTEGER PRIMARY KEY,"
                                   "contact_id       INTEGER,"
                                   "address          TEXT NOT NULL,"
                                   "note             TEXT NOT NULL,"
                                   "mail             TEXT NOT NULL,"
                                   "FOREIGN KEY(contact_id) REFERENCES contacts(_id)"
                                   ");";
};

M module-db/Tables/ContactsGroups.cpp => module-db/Tables/ContactsGroups.cpp +6 -54
@@ 3,43 3,6 @@

#include "ContactsGroups.hpp"

const char *createTablesQuery = "CREATE TABLE IF NOT EXISTS contact_groups("
                                "  _id  INTEGER PRIMARY KEY,"
                                "  name TEXT NOT NULL UNIQUE"
                                ");"
                                "CREATE TABLE IF NOT EXISTS contact_match_groups("
                                "  _id        INTEGER PRIMARY KEY,"
                                "  group_id   INTEGER,"
                                "  contact_id INTEGER,"
                                "  FOREIGN KEY(group_id) REFERENCES contact_groups(_id)"
                                "      ON DELETE CASCADE,"
                                "  FOREIGN KEY(contact_id) REFERENCES contacts(_id)"
                                "      ON DELETE CASCADE,"
                                "  CONSTRAINT unique_group_contact"
                                "      UNIQUE (group_id,contact_id)"
                                ");";
const char *createIndices = "CREATE INDEX IF NOT EXISTS contact_match_group_index_on_group"
                            "  ON contact_match_groups(group_id);"
                            "CREATE INDEX IF NOT EXISTS contact_match_group_index_on_contact"
                            "  ON contact_match_groups(contact_id);";

const char *addSpecialGroups = "INSERT OR REPLACE INTO contact_groups "
                               " (_id, name)"
                               "VALUES"
                               " (1, 'Favourites'),"
                               " (2, 'ICE'),"
                               " (3, 'Blocked'),"
                               " (4, 'Temporary');";

const char *createTableGroupsProtected = "CREATE TABLE IF NOT EXISTS contact_group_protected"
                                         "(  _id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,"
                                         "   group_id INTEGER)";

const char *protectSpecialGroups = "INSERT INTO contact_group_protected "
                                   " (group_id) "
                                   " VALUES "
                                   " (1),(2),(3),(4);";

namespace statements
{
    const char *countGroups = "SELECT COUNT(*) FROM contact_groups;";


@@ 49,8 12,8 @@ namespace statements
    const char *blockedId    = "SELECT _id FROM contact_groups WHERE name = 'Blocked';";
    const char *temporaryId  = "SELECT _id FROM contact_groups WHERE name = 'Temporary';";

    const char *getId      = "SELECT _id FROM contact_groups WHERE name = '%q';";
    const char *getById    = "SELECT _id, name FROM contact_groups WHERE _id = %u;";
    const char *getId   = "SELECT _id FROM contact_groups WHERE name = '%q';";
    const char *getById = "SELECT _id, name FROM contact_groups WHERE _id = %u;";

    /**
     * delete a group only if it is not a "special group"


@@ 64,10 27,10 @@ namespace statements

    const char *getAllLimtOfset = "SELECT _id, name FROM contact_groups ORDER BY _id LIMIT %lu OFFSET %lu;";

    const char *addGrup         = "INSERT INTO contact_groups (name) VALUES ('%q');";
    const char *addGrup           = "INSERT INTO contact_groups (name) VALUES ('%q');";
    const char *addProtectedGroup = "INSERT INTO conctact_group_protected (group_id) VALUES ('%u');";
    const char *updateGroupName = "UPDATE contact_groups SET name = '%q' WHERE _id = '%u';";
    const char *deleteGroup     = "DELETE FROM table_name WHERE _id = :id;";
    const char *updateGroupName   = "UPDATE contact_groups SET name = '%q' WHERE _id = '%u';";
    const char *deleteGroup       = "DELETE FROM table_name WHERE _id = :id;";

    const char *addContactToGroup = "INSERT INTO contact_match_groups (contact_id, group_id)"
                                    "  VALUES(%u, %u)";


@@ 96,18 59,7 @@ ContactsGroupsTable::ContactsGroupsTable(Database *db) : Table(db)

bool ContactsGroupsTable::create()
{
    if (db->execute(createTablesQuery)) {
        if (db->execute(createIndices)) {
            if (db->execute(addSpecialGroups)) {
                if (db->execute(createTableGroupsProtected)) {
                    if (db->execute(protectSpecialGroups)) {
                        return true;
                    }
                }
            }
        }
    }
    return false;
    return true;
}

bool ContactsGroupsTable::add(ContactsGroupsTableRow entry)

M module-db/Tables/ContactsNameTable.cpp => module-db/Tables/ContactsNameTable.cpp +1 -1
@@ 11,7 11,7 @@ ContactsNameTable::~ContactsNameTable()

bool ContactsNameTable::create()
{
    return db->execute(createTableQuery);
    return true;
}

bool ContactsNameTable::add(ContactsNameTableRow entry)

M module-db/Tables/ContactsNameTable.hpp => module-db/Tables/ContactsNameTable.hpp +0 -7
@@ 56,11 56,4 @@ class ContactsNameTable : public Table<ContactsNameTableRow, ContactNameTableFie
    std::size_t GetCountByName(const std::string &name);

  private:
    const char *createTableQuery = "CREATE TABLE IF NOT EXISTS contact_name("
                                   "_id              INTEGER PRIMARY KEY,"
                                   "contact_id       INTEGER,"
                                   "name_primary     TEXT NOT NULL,"
                                   "name_alternative TEXT NOT NULL,"
                                   "FOREIGN KEY(contact_id) REFERENCES contacts(_id)"
                                   ");";
};

M module-db/Tables/ContactsNumberTable.cpp => module-db/Tables/ContactsNumberTable.cpp +1 -1
@@ 11,7 11,7 @@ ContactsNumberTable::~ContactsNumberTable()

bool ContactsNumberTable::create()
{
    return db->execute(createTableQuery);
    return true;
}

bool ContactsNumberTable::add(ContactsNumberTableRow entry)

M module-db/Tables/ContactsNumberTable.hpp => module-db/Tables/ContactsNumberTable.hpp +0 -8
@@ 56,12 56,4 @@ class ContactsNumberTable : public Table<ContactsNumberTableRow, ContactNumberTa
    uint32_t countByFieldId(const char *field, uint32_t id) override final;

  private:
    const char *createTableQuery = "CREATE TABLE IF NOT EXISTS contact_number("
                                   "_id              INTEGER PRIMARY KEY,"
                                   "contact_id       INTEGER,"
                                   "number_user      TEXT NOT NULL,"
                                   "number_e164      TEXT NOT NULL,"
                                   "type             INTEGER,"
                                   "FOREIGN KEY(contact_id) REFERENCES contacts(_id)"
                                   ");";
};

M module-db/Tables/ContactsRingtonesTable.cpp => module-db/Tables/ContactsRingtonesTable.cpp +1 -1
@@ 11,7 11,7 @@ ContactsRingtonesTable::~ContactsRingtonesTable()

bool ContactsRingtonesTable::create()
{
    return db->execute(createTableQuery);
    return true;
}

bool ContactsRingtonesTable::add(ContactsRingtonesTableRow entry)

M module-db/Tables/ContactsRingtonesTable.hpp => module-db/Tables/ContactsRingtonesTable.hpp +0 -6
@@ 57,10 57,4 @@ class ContactsRingtonesTable : public Table<ContactsRingtonesTableRow, ContactRi
    uint32_t countByFieldId(const char *field, uint32_t id) override final;

  private:
    const char *createTableQuery = "CREATE TABLE IF NOT EXISTS contact_ringtones("
                                   "_id              INTEGER PRIMARY KEY,"
                                   "contact_id       INTEGER,"
                                   "asset_path       TEXT NOT NULL,"
                                   "FOREIGN KEY(contact_id) REFERENCES contacts(_id) ON DELETE CASCADE"
                                   ");";
};

M module-db/Tables/ContactsTable.cpp => module-db/Tables/ContactsTable.cpp +1 -1
@@ 35,7 35,7 @@ ContactsTable::~ContactsTable()

bool ContactsTable::create()
{
    return db->execute(createTableQuery);
    return true;
}

bool ContactsTable::add(ContactsTableRow entry)

M module-db/Tables/ContactsTable.hpp => module-db/Tables/ContactsTable.hpp +0 -10
@@ 89,14 89,4 @@ class ContactsTable : public Table<ContactsTableRow, ContactTableFields>
    std::string GetSortedByNameQueryString(ContactQuerySection section);

  private:
    const char *createTableQuery =
        "CREATE TABLE IF NOT EXISTS contacts("
        "_id              INTEGER PRIMARY KEY,"
        "name_id          INTEGER,"
        "numbers_id       TEXT NOT NULL,"
        "ring_id          INTEGER,"
        "address_id       INTEGER,"
        "speeddial        TEXT NOT NULL,"
        "FOREIGN KEY(name_id) REFERENCES contact_name(_id) FOREIGN KEY(ring_id) REFERENCES contact_ringtones(_id)"
        ");";
};