@socialgouv/matomo-postgres 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/createTable.js +12 -12
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@socialgouv/matomo-postgres",
3
3
  "description": "Extract visitor events from Matomo API and push to Postgres",
4
- "version": "1.5.0",
4
+ "version": "1.5.1",
5
5
  "types": "types/index.d.ts",
6
6
  "license": "Apache-2.0",
7
7
  "main": "src/index.js",
@@ -61,18 +61,18 @@ CREATE TABLE IF NOT EXISTS ${table}
61
61
  await client.query(text, []);
62
62
 
63
63
  const migrations = [
64
- `CREATE INDEX IF NOT EXISTS idx_dimension1 ON matomo(dimension1);
65
- CREATE INDEX IF NOT EXISTS idx_dimension2 ON matomo(dimension2);
66
- CREATE INDEX IF NOT EXISTS idx_dimension3 ON matomo(dimension3);
67
- CREATE INDEX IF NOT EXISTS idx_dimension4 ON matomo(dimension4);
68
- CREATE INDEX IF NOT EXISTS idx_dimension5 ON matomo(dimension5);
69
- CREATE INDEX IF NOT EXISTS idx_userid ON matomo(userid);
70
- CREATE INDEX IF NOT EXISTS idx_actionurl ON matomo(action_url);
71
- CREATE INDEX IF NOT EXISTS idx_region ON matomo(region);`,
72
- `ALTER TABLE matomo ADD COLUMN IF NOT EXISTS visitorid text;
73
- ALTER TABLE matomo ADD COLUMN IF NOT EXISTS referrertype text;
74
- ALTER TABLE matomo ADD COLUMN IF NOT EXISTS referrername text;
75
- CREATE INDEX IF NOT EXISTS idx_visitorid ON matomo(visitorid);`,
64
+ `CREATE INDEX IF NOT EXISTS idx_dimension1 ON ${table}(dimension1);
65
+ CREATE INDEX IF NOT EXISTS idx_dimension2 ON ${table}(dimension2);
66
+ CREATE INDEX IF NOT EXISTS idx_dimension3 ON ${table}(dimension3);
67
+ CREATE INDEX IF NOT EXISTS idx_dimension4 ON ${table}(dimension4);
68
+ CREATE INDEX IF NOT EXISTS idx_dimension5 ON ${table}(dimension5);
69
+ CREATE INDEX IF NOT EXISTS idx_userid ON ${table}(userid);
70
+ CREATE INDEX IF NOT EXISTS idx_actionurl ON ${table}(action_url);
71
+ CREATE INDEX IF NOT EXISTS idx_region ON ${table}(region);`,
72
+ `ALTER TABLE ${table} ADD COLUMN IF NOT EXISTS visitorid text;
73
+ ALTER TABLE ${table} ADD COLUMN IF NOT EXISTS referrertype text;
74
+ ALTER TABLE ${table} ADD COLUMN IF NOT EXISTS referrername text;
75
+ CREATE INDEX IF NOT EXISTS idx_visitorid ON ${table}(visitorid);`,
76
76
  ];
77
77
 
78
78
  for (const query of migrations) {