Skip to content

fix: drop eql schema on install #121

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/schema.sql
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
CREATE SCHEMA IF NOT EXISTS eql_v2;
DROP SCHEMA IF EXISTS eql_v2 CASCADE;
CREATE SCHEMA eql_v2;
10 changes: 1 addition & 9 deletions tasks/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,13 @@ echo

# Install
cat release/cipherstash-encrypt.sql | docker exec -i ${container_name} psql ${connection_url} -f-
# if cat release/cipherstash-encrypt.sql | docker exec -i ${container_name} psql ${connection_url} -f- | grep -q "ERROR"; then
# echo
# echo '******************************************************'
# echo '* ❌ ERROR installing release/cipherstash-encrypt.sql'
# echo '******************************************************'
# echo

# exit 1
# fi


cat tests/test_helpers.sql | docker exec -i ${container_name} psql ${connection_url} -f-
cat tests/ore.sql | docker exec -i ${container_name} psql ${connection_url} -f-
cat tests/ste_vec.sql | docker exec -i ${container_name} psql ${connection_url} -f-


if [ $usage_test = "false" ]; then
find src -type f -path "*_test.sql" | while read -r sql_file; do
echo $sql_file
Expand Down
8 changes: 5 additions & 3 deletions tasks/uninstall.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@

DO $$
BEGIN
EXECUTE format('ALTER TABLE IF EXISTS %I RENAME TO %I_%s', 'eql_v2_configuration','eql_v2_configuration_', to_char(current_date,'YYYYMMDD')::TEXT);
ALTER TABLE IF EXISTS public.eql_v2_configuration DROP CONSTRAINT IF EXISTS eql_v2_configuration_data_check;

EXECUTE format('ALTER TABLE IF EXISTS %I RENAME TO %I_%s', 'eql_v2_configuration','eql_v2_configuration_', to_char(current_date,'YYYYMMDD')::TEXT);

RAISE NOTICE 'EQL configuration archived as %_%','eql_v2_configuration_', to_char(current_date,'YYYYMMDD')::TEXT;
END
$$;

ALTER TABLE public.eql_v2_configuration DROP CONSTRAINT IF EXISTS eql_v2_configuration_data_check;

DROP SCHEMA IF EXISTS eql_v2 CASCADE;