forked from openreplay/openreplay
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
119 additions
and
51 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CREATE OR REPLACE FUNCTION openreplay_version AS() -> 'v1.18.0-ee'; |
2 changes: 1 addition & 1 deletion
2
ee/scripts/schema/db/init_dbs/clickhouse/create/init_schema.sql
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
29 changes: 29 additions & 0 deletions
29
ee/scripts/schema/db/init_dbs/postgresql/1.18.0/1.18.0.sql
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,29 @@ | ||
\set previous_version 'v1.17.0-ee' | ||
\set next_version 'v1.18.0-ee' | ||
SELECT openreplay_version() AS current_version, | ||
openreplay_version() = :'previous_version' AS valid_previous, | ||
openreplay_version() = :'next_version' AS is_next | ||
\gset | ||
|
||
\if :valid_previous | ||
\echo valid previous DB version :'previous_version', starting DB upgrade to :'next_version' | ||
BEGIN; | ||
SELECT format($fn_def$ | ||
CREATE OR REPLACE FUNCTION openreplay_version() | ||
RETURNS text AS | ||
$$ | ||
SELECT '%1$s' | ||
$$ LANGUAGE sql IMMUTABLE; | ||
$fn_def$, :'next_version') | ||
\gexec | ||
|
||
-- | ||
DROP FUNCTION IF EXISTS events.funnel(steps integer[], m integer); | ||
|
||
COMMIT; | ||
|
||
\elif :is_next | ||
\echo new version detected :'next_version', nothing to do | ||
\else | ||
\warn skipping DB upgrade of :'next_version', expected previous version :'previous_version', found :'current_version' | ||
\endif |
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
28 changes: 28 additions & 0 deletions
28
ee/scripts/schema/db/rollback_dbs/postgresql/1.18.0/1.18.0.sql
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,28 @@ | ||
\set previous_version 'v1.18.0-ee' | ||
\set next_version 'v1.17.0-ee' | ||
SELECT openreplay_version() AS current_version, | ||
openreplay_version() = :'previous_version' AS valid_previous, | ||
openreplay_version() = :'next_version' AS is_next | ||
\gset | ||
|
||
\if :valid_previous | ||
\echo valid previous DB version :'previous_version', starting DB downgrade to :'next_version' | ||
BEGIN; | ||
SELECT format($fn_def$ | ||
CREATE OR REPLACE FUNCTION openreplay_version() | ||
RETURNS text AS | ||
$$ | ||
SELECT '%1$s' | ||
$$ LANGUAGE sql IMMUTABLE; | ||
$fn_def$, :'next_version') | ||
\gexec | ||
|
||
-- | ||
|
||
COMMIT; | ||
|
||
\elif :is_next | ||
\echo new version detected :'next_version', nothing to do | ||
\else | ||
\warn skipping DB downgrade of :'next_version', expected previous version :'previous_version', found :'current_version' | ||
\endif |
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,29 @@ | ||
\set previous_version 'v1.17.0' | ||
\set next_version 'v1.18.0' | ||
SELECT openreplay_version() AS current_version, | ||
openreplay_version() = :'previous_version' AS valid_previous, | ||
openreplay_version() = :'next_version' AS is_next | ||
\gset | ||
|
||
\if :valid_previous | ||
\echo valid previous DB version :'previous_version', starting DB upgrade to :'next_version' | ||
BEGIN; | ||
SELECT format($fn_def$ | ||
CREATE OR REPLACE FUNCTION openreplay_version() | ||
RETURNS text AS | ||
$$ | ||
SELECT '%1$s' | ||
$$ LANGUAGE sql IMMUTABLE; | ||
$fn_def$, :'next_version') | ||
\gexec | ||
|
||
-- | ||
DROP FUNCTION IF EXISTS events.funnel(steps integer[], m integer); | ||
|
||
COMMIT; | ||
|
||
\elif :is_next | ||
\echo new version detected :'next_version', nothing to do | ||
\else | ||
\warn skipping DB upgrade of :'next_version', expected previous version :'previous_version', found :'current_version' | ||
\endif |
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
29 changes: 29 additions & 0 deletions
29
scripts/schema/db/rollback_dbs/postgresql/1.18.0/1.18.0.sql
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,29 @@ | ||
\set previous_version 'v1.18.0' | ||
\set next_version 'v1.17.0' | ||
SELECT openreplay_version() AS current_version, | ||
openreplay_version() = :'previous_version' AS valid_previous, | ||
openreplay_version() = :'next_version' AS is_next | ||
\gset | ||
|
||
\if :valid_previous | ||
\echo valid previous DB version :'previous_version', starting DB downgrade to :'next_version' | ||
BEGIN; | ||
SELECT format($fn_def$ | ||
CREATE OR REPLACE FUNCTION openreplay_version() | ||
RETURNS text AS | ||
$$ | ||
SELECT '%1$s' | ||
$$ LANGUAGE sql IMMUTABLE; | ||
$fn_def$, :'next_version') | ||
\gexec | ||
|
||
-- | ||
|
||
|
||
COMMIT; | ||
|
||
\elif :is_next | ||
\echo new version detected :'next_version', nothing to do | ||
\else | ||
\warn skipping DB downgrade of :'next_version', expected previous version :'previous_version', found :'current_version' | ||
\endif |