﻿/* carga de idiomas */
insert into tm_languages (id, name) VALUES ('ES','Español');
insert into tm_languages (id, name) VALUES ('EN','Inglés');
insert into tm_languages (id, name) VALUES ('CA','Catalán');

/* carga de roles */
insert into tm_rols (id, name, description, availablequerys) values ('A', 'Anónimo', 'Usuario anónimo o sin registrar', 0);
insert into tm_rols (id, name, description, availablequerys) values ('R', 'Registrado', 'Usuario registrado', 5);
insert into tm_rols (id, name, description, availablequerys) values ('P', 'Premium', 'Usuario Premium', 20);

/* carga de usuarios */
insert into tm_users (id,name,surname1,surname2,email,pass,cdlanguage,cduseract) values (1,'Angel','Contreras','Picazo','angelcon@uoc.edu','1a1dc91c9dd325c63251ddf0c454bc72','ES',1);

/* carga de admins */
insert into tm_admins (id, cduser, cduseract) values (1,1,1);

commit;



insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 41.385064, 2.173403 from tm_locations where countrycode='ES' and upper(name)='BARCELONA');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 43.263013, -2.934985 from tm_locations where countrycode='ES' and upper(name)='BILBAO');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 28.123546, -15.436257 from tm_locations where countrycode='ES' and upper(name)='LAS PALMAS');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 40.416775, -3.703790 from tm_locations where countrycode='ES' and upper(name)='MADRID');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 36.721261, -4.421266 from tm_locations where countrycode='ES' and upper(name)='MALAGA');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 37.992240, -1.130654 from tm_locations where countrycode='ES' and upper(name)='MURCIA');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 39.569600, 2.65016 from tm_locations where countrycode='ES' and upper(name)='PALMA');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 37.389092, -5.984459 from tm_locations where countrycode='ES' and upper(name)='SEVILLE');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 39.469907, -0.376288 from tm_locations where countrycode='ES' and upper(name)='VALENCIA');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 41.648823, -0.889085 from tm_locations where countrycode='ES' and upper(name)='ZARAGOZA');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 40.463667, -3.74922 from tm_locations where countrycode='ES' and upper(name)='SPAIN');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 51.507351, -0.127758 from tm_locations where countrycode='GB' and upper(name)='LONDON');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 40.712784, -74.005941 from tm_locations where countrycode='US' and upper(name)='NEW YORK');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 48.856614, 2.352222 from tm_locations where countrycode='FR' and upper(name)='PARIS');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 46.227638, 2.213749 from tm_locations where countrycode='FR' and upper(name)='FRANCE');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 28.033886, 1.659626 from tm_locations where countrycode='DZ' and upper(name)='ALGERIA');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, -38.416097, -63.616672 from tm_locations where countrycode='AR' and upper(name)='ARGENTINA');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, -25.274398, 133.775136 from tm_locations where countrycode='AU' and upper(name)='AUSTRALIA');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 47.516231, 14.550072 from tm_locations where countrycode='AT' and upper(name)='AUSTRIA');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 50.503887, 4.469936 from tm_locations where countrycode='BE' and upper(name)='BELGIUM');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, -14.235004, -51.92528 from tm_locations where countrycode='BR' and upper(name)='BRAZIL');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 56.130366, -106.346771 from tm_locations where countrycode='CA' and upper(name)='CANADA');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 41.878114, -87.629798 from tm_locations where countrycode='US' and upper(name)='CHICAGO');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, -35.675147, -71.542969 from tm_locations where countrycode='CL' and upper(name)='CHILE');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 4.570868, -74.297333 from tm_locations where countrycode='CO' and upper(name)='COLOMBIA');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 56.263920, 9.501785 from tm_locations where countrycode='DK' and upper(name)='DENMARK');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, -1.831239, -78.183406 from tm_locations where countrycode='EC' and upper(name)='ECUADOR');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 50.110922, 8.682127 from tm_locations where countrycode='DE' and upper(name)='FRANKFURT');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 51.165691, 10.451526 from tm_locations where countrycode='DE' and upper(name)='GERMANY');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 39.074208, 21.824312 from tm_locations where countrycode='GR' and upper(name)='GREECE');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 20.593684, 78.96288 from tm_locations where countrycode='IN' and upper(name)='INDIA');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 41.871940, 12.56738 from tm_locations where countrycode='IT' and upper(name)='ITALY');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 36.204824, 138.252924 from tm_locations where countrycode='JP' and upper(name)='JAPAN');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 23.634501, -102.552784 from tm_locations where countrycode='MX' and upper(name)='MEXICO');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 60.472024, 8.468946 from tm_locations where countrycode='NO' and upper(name)='NORWAY');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 51.919438, 19.145136 from tm_locations where countrycode='PL' and upper(name)='POLAND');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 39.399872, -8.224454 from tm_locations where countrycode='PT' and upper(name)='PORTUGAL');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 61.524010, 105.318756 from tm_locations where countrycode='RU' and upper(name)='RUSSIA');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 46.818188, 8.227512 from tm_locations where countrycode='CH' and upper(name)='SWITZERLAND');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 60.128161, 18.643501 from tm_locations where countrycode='SE' and upper(name)='SWEDEN');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 55.378051, -3.435973 from tm_locations where countrycode='GB' and upper(name)='UNITED KINGDOM');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 37.090240, -95.712891 from tm_locations where countrycode='US' and upper(name)='UNITED STATES');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 23.424076, 53.847818 from tm_locations where countrycode='AE' and upper(name)='UNITED ARAB EMIRATES');
insert into tm_activelocations (location, name, latitude, longitude) (select id, name, 6.423750, -66.58973 from tm_locations where countrycode='VE' and upper(name)='VENEZUELA');
commit;



insert into tm_activelocations (location, name) (select id, name from tm_locations where countrycode='ES' and upper(name)='VALENCIA');
insert into tm_activelocations (location, name) (select id, name from tm_locations where countrycode='FR' and upper(name)='FRANCE');
insert into tm_activelocations (location, name) (select id, name from tm_locations where countrycode='IT' and upper(name)='ITALY');



