-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow Secrets for Migrations - CLI (#831)
- Loading branch information
1 parent
c130604
commit 8baa184
Showing
8 changed files
with
116 additions
and
11 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,2 @@ | ||
docker-compose.yml | ||
migration-test-2/* |
16 changes: 16 additions & 0 deletions
16
.../examples/migrations-2/tembo-migrations/migration-test-2/20240621_create_custom_table.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,16 @@ | ||
CREATE TABLE IF NOT EXISTS custom_secret_table ( | ||
id SERIAL PRIMARY KEY, | ||
secret_value TEXT NOT NULL | ||
); | ||
|
||
CREATE OR REPLACE FUNCTION set_custom_parameters() RETURNS void AS $$ | ||
BEGIN | ||
PERFORM set_config('tembo.custom_secret', current_setting('tembo.custom_secret'), false); | ||
END; | ||
$$ LANGUAGE plpgsql; | ||
|
||
SELECT set_custom_parameters(); | ||
|
||
INSERT INTO custom_secret_table (secret_value) VALUES (current_setting('tembo.custom_secret')); | ||
|
||
SELECT secret_value FROM custom_secret_table WHERE secret_value = current_setting('tembo.custom_secret'); |
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,4 @@ | ||
[migration-test-2] | ||
environment = "dev" | ||
instance_name = "migration-test-2" | ||
stack_type = "Standard" |
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