Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Dec 14, 2023. It is now read-only.

Commit 38fe3ec

Browse files
committed
Add migrations to enable new event form functionality
1 parent 8dfabb8 commit 38fe3ec

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE cd_events ADD column new_form BOOLEAN DEFAULT FALSE;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
DO $$
2+
BEGIN
3+
DROP VIEW v_event_occurrences;
4+
CREATE OR REPLACE VIEW v_event_occurrences AS (
5+
SELECT id, name, country, city, address, created_at, created_by, type, description, dojo_id, position, public,
6+
status, recurring_type, dates, ticket_approval, notify_on_applicant, eventbrite_id, eventbrite_url, use_dojo_address,
7+
start_time::timestamp, end_time::timestamp, new_form FROM (
8+
SELECT *, unnest(dates)->>'startTime' as start_time, unnest(dates)->>'endTime' as end_time FROM cd_events
9+
) x WHERE start_time IS NOT NULL AND start_time NOT LIKE 'Invalid%' AND end_time IS NOT NULL AND end_time NOT LIKE 'Invalid%'
10+
);
11+
END;
12+
$$

0 commit comments

Comments
 (0)