Skip to content

Commit 6917c7f

Browse files
committed
Incrementally testing GH action.
1 parent 55c2b37 commit 6917c7f

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

.github/workflows/duplicate-prod-db.yml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,27 @@ jobs:
137137
sleep 10 # Wait for the tunnel to establish
138138
139139
export PGPASSWORD=$DEST_DATABASE_PASSWORD
140-
cat <<'EOF' | psql -h localhost -p 5454 -U data_feeds_user -d $DEST_DATABASE_NAME
141-
DO $$
142-
DECLARE
143-
r RECORD;
144-
BEGIN
145-
FOR r IN
146-
SELECT table_name
147-
FROM information_schema.tables
148-
WHERE table_schema = 'public'
149-
LOOP
150-
EXECUTE format('ALTER TABLE public.%I OWNER TO postgres;', r.table_name);
151-
END LOOP;
152-
END
153-
$$;
140+
141+
# cat <<'EOF' | psql -h localhost -p 5454 -U data_feeds_user -d $DEST_DATABASE_NAME
142+
# DO $$
143+
# DECLARE
144+
# r RECORD;
145+
# BEGIN
146+
# FOR r IN
147+
# SELECT table_name
148+
# FROM information_schema.tables
149+
# WHERE table_schema = 'public'
150+
# LOOP
151+
# EXECUTE format('ALTER TABLE public.%I OWNER TO postgres;', r.table_name);
152+
# END LOOP;
153+
# END
154+
# $$;
155+
# EOF
156+
157+
cat <<'EOF' | psql -h localhost -p 5454 -U data_feeds_user -d $DEST_DATABASE_NAME
158+
UPDATE feed
159+
SET feed_contact_email = REPLACE(feed_contact_email, '@', '_') || '@mobilitydata.org'
160+
WHERE feed_contact_email IS NOT NULL
161+
AND TRIM(feed_contact_email) <> '';
154162
EOF
155163

0 commit comments

Comments
 (0)