Skip to content

Commit

Permalink
#38 handle the case when the ticket category description is null
Browse files Browse the repository at this point in the history
  • Loading branch information
syjer committed Aug 15, 2015
1 parent b204c65 commit 330c97e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit 330c97e

Please sign in to comment.