app2-api/script-carga-bd-anterior.sql

115 lines
5.4 KiB
MySQL
Raw Normal View History

2019-07-09 15:56:17 +00:00
Cargar
script-carga-bd-users.sql
script-carga-bd-event_types.sql
script-carga-bd-multimedia_types.sql
script-carga-bd-values.sql
script-carga-bd-venues.sql
2019-07-16 15:34:14 +00:00
script-carga-bd-envents_venues_aux.sql
2019-07-09 15:56:17 +00:00
script-carga-bd-speaker_types.sql
2019-07-17 14:47:27 +00:00
script-carga-bd-entidades.sql
insert into lqdvi_v2.entities_entities_types (entityid, typeid, createdAt, updatedAt)
select id, '76b17163-a167-11e9-a57c-000c295f0f58', now(), now() from `entities`
2019-07-09 15:56:17 +00:00
insert into lqdvi_v2.`multimedia_files` (id, name, description, typeid, provider, code, url, createdAt, userId, updatedAt)
SELECT a.id, a.title, a.description, '166fb0aa-5182-4d22-addd-818337194cd7', a.provider, a.code, a.url, a.created, '0939bb2a-d33d-4290-ac81-fc9faa1c015e', now()
FROM lqdvi.`video` as a;
2019-07-17 14:47:27 +00:00
insert into lqdvi_v2.`events` (id, name, description, init_date, init_available_date, end_available_date, gmt, assistants, confirmed, state, typeId, url_streaming, url_poll, url_registration,
2019-07-09 15:56:17 +00:00
userId, CreatedAt, venueId, campaign_text, UpdatedAt)
SELECT id, title, address , date, avalible, date, GMT, assistants, confirmed, status, typeId, streaming, poll, url_registration, '0939bb2a-d33d-4290-ac81-fc9faa1c015e',
now(), '120c5a99-6e9b-4cc2-875a-af0f8db00e4b', campaign_text, now()
FROM lqdvi.conference;
2019-07-16 15:34:14 +00:00
update events e
set e.venueID = (select a.venueID from envents_venues_aux a where a.eventID = e.ID);
2019-07-09 15:56:17 +00:00
insert into lqdvi_v2.speakers
(id, name, description, slogan, twitter, facebook, youtube, linkedin, instagram, web, state, typeId, userId, createdAt, updatedAt)
SELECT id, name, description, slogan, twitter, facebook, youtube, linkedin, instagram, web, 'publicado', 1, '0939bb2a-d33d-4290-ac81-fc9faa1c015e', now(), now()
FROM lqdvi.speaker;
insert into lqdvi_v2.speakers_values (speakerid, valueId, createdAt, updatedAt)
SELECT speakerid, valueid, now(), now() FROM lqdvi.`speaker-value`;
//insertamos los videos relacionados
insert into lqdvi_v2.`multimedias` (id, entityId, entityName, multimediafileId, type, createdAt, updatedAt)
SELECT UUID() as ID, conferenceId as eventID, 'event', videoId as multimediafileid, 'relacion', now(), now()
FROM lqdvi.`video-conference`
where videoId in (select id from lqdvi_v2.multimedia_files);
//insertamos los videos resumen de cada conferencia
insert into lqdvi_v2.`multimedias` (id, entityId, entityName, multimediafileId, type, createdAt, updatedAt)
SELECT UUID() as ID, Id as eventID, 'event', resume as multimediafileid, 'resume', now(), now()
FROM lqdvi.`conference`
where resume in (select id from lqdvi_v2.multimedia_files);
//insertamos las imagenes de los ponentes
insert into lqdvi_v2.multimedia_files (id, name, description, typeId, provider, url, userId, createdAt, updatedAt)
SELECT UUID() as ID, concat(name, ' - picture'), id as speakerId, '14c3810c-aca0-440a-b597-f72a7ceb59dc', 'cdn', picture, '0939bb2a-d33d-4290-ac81-fc9faa1c015e', now(), now() FROM lqdvi.speaker
where picture is not null;
insert into lqdvi_v2.multimedias (id, multimediafileid, entityid, entityname, type, createdat, updatedat)
SELECT UUID() as ID, id as multimediafileid, description as speakerid, 'speaker', 'picture-speaker', now(), now() FROM lqdvi_v2.multimedia_files
where name like '%picture%';
insert into lqdvi_v2.multimedia_files (id, name, description, typeId, provider, url, userId, createdAt, updatedAt)
SELECT UUID() as ID, concat(name, ' - wallpaper'), id as speakerId, '14c3810c-aca0-440a-b597-f72a7ceb59dc', 'cdn', wallpaper, '0939bb2a-d33d-4290-ac81-fc9faa1c015e', now(), now() FROM lqdvi.speaker
where wallpaper is not null;
insert into lqdvi_v2.multimedias (id, multimediafileid, entityid, entityname, type, createdat, updatedat)
SELECT UUID() as ID, id as multimediafileid, description as speakerid, 'speaker', 'wallpaper-speaker', now(), now() FROM lqdvi_v2.multimedia_files
where name like '%wallpaper%';
insert into lqdvi_v2.`multimedias` (id, entityId, entityName, multimediafileId, type, createdAt, updatedAt)
SELECT UUID() as ID, speakerID as eventID, 'speaker', videoId as multimediafileid, 'relacion-speaker', now(), now()
FROM lqdvi.`video-speaker`
where videoId in (select id from lqdvi_v2.multimedia_files);
2019-07-17 14:47:27 +00:00
//METEMOS LOS DETALLES DE LOS CONGRESOS AGENDAS DE TODOS LOS CONGRESOS
2019-07-09 15:56:17 +00:00
Cargar
2019-07-17 14:47:27 +00:00
script-carga-bd-events_details.sql
2019-07-09 15:56:17 +00:00
2019-07-17 15:13:55 +00:00
update lqdvi_v2.events_details
set type = 'speaker'
where description like'%conference-speaker%';
update lqdvi_v2.events_details
set type = 'info'
where type is null;
2019-07-09 15:56:17 +00:00
//Modificamos la tabla para crear otro campo autoinc que nos rellene el order
/*
insert into lqdvi_v2.events_schedules (id, eventId, speakerId, description, createdAt, updatedAt)
SELECT id, conferenceId, speakerId,
CONCAT(DATE_FORMAT(init_hour, "%H:%i"), ' - ', COALESCE(DATE_FORMAT(end_hour, "%H:%i"),''), ' - ', COALESCE(title,''), ' - ',COALESCE(info,'') ) as description,
now(), now()
FROM lqdvi.event
order by conferenceId, init_hour;
update lqdvi_v2.events_schedules as a
set a.order = nuevoidorder
insert into lqdvi_v2.events_schedules (id, eventId, speakerId, order, description, createdAt, updatedAt)
select UUID() as ID, conferenceId, speakerId, 0, 'relacion conference-speaker modelo anterior', now(), now() FROM lqdvi.`conference-speaker`;
*/
//Metemos las preguntas de los congresos
insert into lqdvi_v2.events_questions (id, eventId, speakerId, anonimous, answered, discared, answer, userId, createdAt, updatedAt)
SELECT UUID() as ID, conferenceId, speakerId, anonymous, answered, discared, content, '0939bb2a-d33d-4290-ac81-fc9faa1c015e', created, now() FROM lqdvi.question;
2019-07-17 14:47:27 +00:00
2019-07-09 15:56:17 +00:00