From 330c97e2c4056ba6e4868e950c44e8b63bc927d5 Mon Sep 17 00:00:00 2001 From: Sylvain Jermini Date: Sat, 15 Aug 2015 20:02:49 +0200 Subject: [PATCH] #38 handle the case when the ticket category description is null --- .../alfio/db/HSQLDB/V12_1.5.15__REMOVE_DESCRIPTION.sql | 6 +++--- .../alfio/db/PGSQL/V12_1.5.15__REMOVE_DESCRIPTION.sql | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/resources/alfio/db/HSQLDB/V12_1.5.15__REMOVE_DESCRIPTION.sql b/src/main/resources/alfio/db/HSQLDB/V12_1.5.15__REMOVE_DESCRIPTION.sql index 216912ffd0..0b972e2b60 100644 --- a/src/main/resources/alfio/db/HSQLDB/V12_1.5.15__REMOVE_DESCRIPTION.sql +++ b/src/main/resources/alfio/db/HSQLDB/V12_1.5.15__REMOVE_DESCRIPTION.sql @@ -23,11 +23,11 @@ SELECT id as event_id_fk, 'it' as locale, 'DESCRIPTION' as type, description FRO ); -insert into ticket_category_text ((SELECT ticket_category.id as ticket_category_id_fk, 'en' as locale, description FROM TICKET_CATEGORY where ((select locales from event where event.id = event_id) = 7) and (select count(*) from ticket_category_text where ticket_category_id_fk = ticket_category.id) = 0) +insert into ticket_category_text ((SELECT ticket_category.id as ticket_category_id_fk, 'en' as locale, description FROM TICKET_CATEGORY where description is not null and ((select locales from event where event.id = event_id) = 7) and (select count(*) from ticket_category_text where ticket_category_id_fk = ticket_category.id) = 0) union all -(SELECT ticket_category.id as ticket_category_id_fk, 'de' as locale, description FROM TICKET_CATEGORY where ((select locales from event where event.id = event_id) = 7) and (select count(*) from ticket_category_text where ticket_category_id_fk = ticket_category.id) = 0) +(SELECT ticket_category.id as ticket_category_id_fk, 'de' as locale, description FROM TICKET_CATEGORY where description is not null and ((select locales from event where event.id = event_id) = 7) and (select count(*) from ticket_category_text where ticket_category_id_fk = ticket_category.id) = 0) union all -(SELECT ticket_category.id as ticket_category_id_fk, 'it' as locale, description FROM TICKET_CATEGORY where ((select locales from event where event.id = event_id) = 7) and (select count(*) from ticket_category_text where ticket_category_id_fk = ticket_category.id) = 0)); +(SELECT ticket_category.id as ticket_category_id_fk, 'it' as locale, description FROM TICKET_CATEGORY where description is not null and ((select locales from event where event.id = event_id) = 7) and (select count(*) from ticket_category_text where ticket_category_id_fk = ticket_category.id) = 0)); ALTER TABLE event DROP COLUMN description; ALTER TABLE ticket_category DROP COLUMN description; diff --git a/src/main/resources/alfio/db/PGSQL/V12_1.5.15__REMOVE_DESCRIPTION.sql b/src/main/resources/alfio/db/PGSQL/V12_1.5.15__REMOVE_DESCRIPTION.sql index c9e37dff06..d101d3b976 100644 --- a/src/main/resources/alfio/db/PGSQL/V12_1.5.15__REMOVE_DESCRIPTION.sql +++ b/src/main/resources/alfio/db/PGSQL/V12_1.5.15__REMOVE_DESCRIPTION.sql @@ -23,11 +23,11 @@ SELECT id as event_id_fk, 'it' as locale, 'DESCRIPTION' as type, description FRO ); -insert into ticket_category_text ((SELECT ticket_category.id as ticket_category_id_fk, 'en' as locale, description FROM TICKET_CATEGORY where ((select locales from event where event.id = event_id) = 7) and (select count(*) from ticket_category_text where ticket_category_id_fk = ticket_category.id) = 0) +insert into ticket_category_text ((SELECT ticket_category.id as ticket_category_id_fk, 'en' as locale, description FROM TICKET_CATEGORY where description is not null and ((select locales from event where event.id = event_id) = 7) and (select count(*) from ticket_category_text where ticket_category_id_fk = ticket_category.id) = 0) union all -(SELECT ticket_category.id as ticket_category_id_fk, 'de' as locale, description FROM TICKET_CATEGORY where ((select locales from event where event.id = event_id) = 7) and (select count(*) from ticket_category_text where ticket_category_id_fk = ticket_category.id) = 0) +(SELECT ticket_category.id as ticket_category_id_fk, 'de' as locale, description FROM TICKET_CATEGORY where description is not null and ((select locales from event where event.id = event_id) = 7) and (select count(*) from ticket_category_text where ticket_category_id_fk = ticket_category.id) = 0) union all -(SELECT ticket_category.id as ticket_category_id_fk, 'it' as locale, description FROM TICKET_CATEGORY where ((select locales from event where event.id = event_id) = 7) and (select count(*) from ticket_category_text where ticket_category_id_fk = ticket_category.id) = 0)); +(SELECT ticket_category.id as ticket_category_id_fk, 'it' as locale, description FROM TICKET_CATEGORY where description is not null and ((select locales from event where event.id = event_id) = 7) and (select count(*) from ticket_category_text where ticket_category_id_fk = ticket_category.id) = 0)); ALTER TABLE event DROP COLUMN description; ALTER TABLE ticket_category DROP COLUMN description; \ No newline at end of file