 
 DROP TABLE IF EXISTS Translation;
 DROP TABLE IF EXISTS InstalledVersion;
+DROP TABLE IF EXISTS DefaultVersion;
 DROP TABLE IF EXISTS CountryVersion;
 DROP TABLE IF EXISTS Version;
 DROP TABLE IF EXISTS Owner;

INSERT INTO Version VALUES('NMV', 'pes', 'ELAM', 'NMV', 'ترجمۀ هزارۀ نو', 'BIBLE', 'NMV.db', 'F', 'F', '2016-09-06',
'The Persian New Millennium Version © 2014, is a production of Elam Ministries. All rights reserved', NULL, NULL);

-- Far East
INSERT INTO Version VALUES ('ERV-CMN', 'cmn', 'BLI', 'ERV-CMN', '圣经–普通话本', 'BIBLE', 'ERV-CMN.db', 'T', 'F', '2016-10-12',
'圣经–普通话本（普通话）© 1999，2015 Bible League International', NULL, NULL);
INSERT INTO Version VALUES ('ERV-IND', 'ind', 'BLI', 'ERV-IND', 'Perjanjian Baru: Versi Mudah Dibaca', 'BIBLE_NT', 'ERV-IND.db', 'T', 'F', '2016-10-12',
'Perjanjian Baru: Versi Mudah Dibaca (VMD) © 2003 Bible League International', NULL, NULL);
INSERT INTO Version VALUES ('ERV-THA', 'tha', 'BLI', 'ERV-THA', 'พระ​คริสต​ธรรม​คัมภีร์ ฉบับ​อ่าน​เข้า​ใจ​ง่าย', 'BIBLE', 'ERV-THA.db', 'T', 'F', '2016-10-12',
'พระคริสต​ธรรม​คัมภีร์: ฉบับ​อ่าน​เข้า​ใจ​ง่าย (ขจง) © 2015 Bible League International', NULL, NULL);
INSERT INTO Version VALUES ('ERV-VIE', 'vie', 'BLI', 'ERV-VIE', 'Thánh Kinh: Bản Phổ thông', 'BIBLE', 'ERV-VIE.db', 'T', 'F', '2016-10-12',
'Thánh Kinh: Bản Phổ thông (BPT) © 2010 Bible League International', NULL, NULL);
-- Wycliffe
-- INSERT INTO Version Values ('amu', 'amu', 'WBT', 'AMU', 'Amuzgo, Guerrero', 'BIBLE_NT', 'AMU.db', 'T', 'F', '2016-09-06',
-- 'Amuzgo, Guerrero, © 1999 by Wycliffe Bible Translators', NULL, NULL);
-- INSERT INTO Version Values ('azg', 'azg', 'WBT', 'AZG', 'Amuzgo, San Pedro Amuzgos', 'BIBLE_NT', 'AZG.db', 'T', 'F', '2016-09-06',
-- 'Amuzgo, San Pedro Amuzgos, © 1992 by Wycliffe Bible Translators', NULL, NULL);




PRIMARY KEY(countryCode, versionCode)
);
INSERT INTO CountryVersion VALUES ('WORLD', 'ARBVDPD');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-AWA');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-ARB');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-BEN');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-BUL');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-CMN');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-ENG');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-HIN');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-HRV');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-HUN');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-IND');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-KAN');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-MAR');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-NEP');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-ORI');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-PAN');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-POR');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-RUS');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-SPA');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-SRP');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-TAM');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-THA');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-UKR');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-URD');
INSERT INTO CountryVersion VALUES ('WORLD', 'ERV-VIE');
INSERT INTO CountryVersion VALUES ('WORLD', 'KJVPD');
INSERT INTO CountryVersion VALUES ('WORLD', 'NMV');
INSERT INTO CountryVersion VALUES ('WORLD', 'WEB');



CREATE TABLE DefaultVersion (
langCode TEXT NOT NULL PRIMARY KEY,
filename TEXT NOT NULL REFERENCES Version(filename)
);
INSERT INTO DefaultVersion VALUES ('ar', 'ARBVDPD.db'); -- Arabic
INSERT INTO DefaultVersion VALUES ('bn', 'ERV-BEN.db'); -- Bengali
INSERT INTO DefaultVersion VALUES ('bg', 'ERV-BUL.db'); -- bulgarian
INSERT INTO DefaultVersion VALUES ('en', 'ERV-ENG.db'); -- English
INSERT INTO DefaultVersion VALUES ('es', 'ERV-SPA.db'); -- Spanish
INSERT INTO DefaultVersion VALUES ('fa', 'NMV.db'); -- Persian
INSERT INTO DefaultVersion VALUES ('hi', 'ERV-HIN.db'); -- Hindi
INSERT INTO DefaultVersion VALUES ('hr', 'ERV-HRV.db'); -- Croatia
INSERT INTO DefaultVersion VALUES ('hu', 'ERV-HUN.db'); -- Hungarian
INSERT INTO DefaultVersion VALUES ('id', 'ERV-IND.db'); -- Indonesian
INSERT INTO DefaultVersion VALUES ('kn', 'ERV-KAN.db'); -- Kannada 
INSERT INTO DefaultVersion VALUES ('mr', 'ERV-MAR.db'); -- Marathi
INSERT INTO DefaultVersion VALUES ('ne', 'ERV-NEP.db'); -- Nepali
INSERT INTO DefaultVersion VALUES ('or', 'ERV-ORI.db'); -- Oriya
INSERT INTO DefaultVersion VALUES ('pt', 'ERV-POR.db'); -- Portuguese
INSERT INTO DefaultVersion VALUES ('pa', 'ERV-PAN.db'); -- Punjabi
INSERT INTO DefaultVersion VALUES ('ru', 'ERV-RUS.db'); -- Russia
INSERT INTO DefaultVersion VALUES ('sr', 'ERV-SRP.db'); -- Serbia
INSERT INTO DefaultVersion VALUES ('ta', 'ERV-TAM.db'); -- Tamil
INSERT INTO DefaultVersion VALUES ('th', 'ERV-THA.db'); -- Thai
INSERT INTO DefaultVersion VALUES ('uk', 'ERV-UKR.db'); -- Ukraine
INSERT INTO DefaultVersion VALUES ('ur', 'ERV-URD.db'); -- Urdu
INSERT INTO DefaultVersion VALUES ('vi', 'ERV-VIE.db'); -- Vietnamese
INSERT INTO DefaultVersion VALUES ('zh', 'ERV-CMN.db'); -- Chinese


CREATE TABLE InstalledVersion (
versionCode NOT NULL PRIMARY KEY REFERENCES Version(versionCode),
startDate NOT NULL,
endDate NULL
);
INSERT INTO InstalledVersion VALUES ('ARBVDPD', '2016-06-01', null);
INSERT INTO InstalledVersion VALUES ('ERV-ENG', '2016-10-14', null);
-- INSERT INTO InstalledVersion VALUES ('CUVSPD', '2016-06-11', null);
-- INSERT INTO InstalledVersion VALUES ('CUVTPD', '2016-06-18', null);
INSERT INTO InstalledVersion VALUES ('ERV-SPA', '2016-10-08', null);
-- INSERT INTO InstalledVersion VALUES ('KJVPD', '2016-05-16', null);
-- INSERT INTO InstalledVersion VALUES ('NMV', '2016-06-27', null);
-- INSERT INTO InstalledVersion VALUES ('WEB', '2016-05-16', null);
-- INSERT INTO InstalledVersion VALUES ('RVR09PD', '2016-05-31', null);



