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

Commit 15f3aa2

Browse files
author
Glen Pike
authored
Merge pull request #440 from CoderDojo/add-online-sessions-flag
Add migration for online_sessions flag
2 parents 6f35191 + 7ed9a04 commit 15f3aa2

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

lib/controllers/lead/save.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ module.exports = function (args, done) {
157157
// Unpack locality info into the root structure of the dojo
158158
if (lead.application.venue) {
159159
dojoApplication.private = lead.application.venue.private;
160+
dojoApplication.onlineSessions = lead.application.venue.onlineSessions;
160161
if (lead.application.venue.geoPoint) dojoApplication.geoPoint = lead.application.venue.geoPoint;
161162
if (lead.application.venue.state) dojoApplication.state = lead.application.venue.state;
162163
if (lead.application.venue.country) dojoApplication.country = lead.application.venue.country;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
DO $$
2+
BEGIN
3+
BEGIN
4+
ALTER TABLE cd_dojos ADD COLUMN online_sessions smallint NOT NULL DEFAULT 0;
5+
EXCEPTION
6+
WHEN duplicate_column THEN RAISE NOTICE 'column online_sessions already exists in cd_dojos.';
7+
END;
8+
END;
9+
$$
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
DO $$
2+
BEGIN
3+
BEGIN
4+
ALTER TABLE cd_dojoleads ADD COLUMN online_sessions smallint NOT NULL DEFAULT 0;
5+
EXCEPTION
6+
WHEN duplicate_column THEN RAISE NOTICE 'column online_sessions already exists in cd_dojoleads.';
7+
END;
8+
END;
9+
$$

0 commit comments

Comments
 (0)