-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding support for basic utm tags (#13)
- Loading branch information
1 parent
8cd8261
commit 73f36ce
Showing
25 changed files
with
279 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { getLibsqlRepo } from "../../repository/repo"; | ||
|
||
async function migrate(): Promise<boolean> { | ||
const db = getLibsqlRepo().db(); | ||
|
||
await db.executeMultiple(` | ||
ALTER TABLE events ADD COLUMN utm_source TEXT; | ||
ALTER TABLE events ADD COLUMN utm_medium TEXT; | ||
ALTER TABLE events ADD COLUMN utm_campaign TEXT; | ||
ALTER TABLE events ADD COLUMN utm_term TEXT; | ||
ALTER TABLE events ADD COLUMN utm_content TEXT; | ||
`); | ||
|
||
return true; | ||
} | ||
|
||
export default migrate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { getPostgresRepo } from "../../repository/repo"; | ||
|
||
async function migrate(): Promise<boolean> { | ||
const sql = getPostgresRepo().db(); | ||
|
||
await sql` | ||
ALTER TABLE events | ||
ADD COLUMN IF NOT EXISTS utm_source TEXT, | ||
ADD COLUMN IF NOT EXISTS utm_medium TEXT, | ||
ADD COLUMN IF NOT EXISTS utm_campaign TEXT, | ||
ADD COLUMN IF NOT EXISTS utm_term TEXT, | ||
ADD COLUMN IF NOT EXISTS utm_content TEXT; | ||
`; | ||
|
||
return true; | ||
} | ||
|
||
export default migrate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { getTimescaleRepo } from "../../repository/repo"; | ||
|
||
async function migrate(): Promise<boolean> { | ||
const sql = getTimescaleRepo().db(); | ||
|
||
await sql` | ||
ALTER TABLE events | ||
ADD COLUMN IF NOT EXISTS utm_source TEXT, | ||
ADD COLUMN IF NOT EXISTS utm_medium TEXT, | ||
ADD COLUMN IF NOT EXISTS utm_campaign TEXT, | ||
ADD COLUMN IF NOT EXISTS utm_term TEXT, | ||
ADD COLUMN IF NOT EXISTS utm_content TEXT; | ||
`; | ||
|
||
return true; | ||
} | ||
|
||
export default migrate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.