Skip to content

Commit 20ffb5f

Browse files
authored
Merge pull request #1104 from opencrvs/amend-populate-location
fix: don't populate location as part of setup-analytics
2 parents 73ede62 + 3b4791d commit 20ffb5f

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

infrastructure/postgres/setup-analytics.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/bin/bash
22
set -euo pipefail
33

4+
# NOTE!
5+
# This setup is ran before core migrations. Therefore you CAN NOT refer to the tables or data in core.
6+
47
# Configuration
58
: "${POSTGRES_HOST:=localhost}"
69
: "${POSTGRES_PORT:=5432}"
@@ -57,13 +60,6 @@ CREATE TABLE IF NOT EXISTS analytics.locations (
5760
location_type TEXT NOT NULL
5861
);
5962
60-
INSERT INTO analytics.locations (id, name, parent_id, location_type)
61-
SELECT id, name, parent_id, location_type FROM app.locations
62-
ON CONFLICT (id) DO UPDATE
63-
SET name = EXCLUDED.name,
64-
parent_id = EXCLUDED.parent_id,
65-
location_type = EXCLUDED.location_type;
66-
6763
CREATE TABLE IF NOT EXISTS analytics.event_actions (
6864
event_type text NOT NULL,
6965
action_type TEXT NOT NULL,

0 commit comments

Comments
 (0)