Skip to content

Commit

Permalink
Try conditional to create schema
Browse files Browse the repository at this point in the history
  • Loading branch information
theory committed Dec 31, 2024
1 parent 7ee6aaa commit 6119aa1
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/App/Sqitch/Engine/snowflake.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
CREATE SCHEMA IF NOT EXISTS &registry;
-- Create the schema but ignore permission errors
EXECUTE IMMEDIATE $$
BEGIN
IF (NOT EXISTS(SELECT * FROM information_schema.schemata WHERE schema_name = UPPER('&registry'))) THEN
CREATE SCHEMA identifier('&registry');
-- COMMENT ON SCHEMA identifier('&registry') IS 'Sqitch database deployment metadata v1.1.';
END IF;
-- EXCEPTION WHEN statement_error THEN
-- IF (sqlstate = '42501') THEN RETURN ''; END IF;
END;
$$;


COMMENT ON SCHEMA &registry IS 'Sqitch database deployment metadata v1.1.';

Expand Down

0 comments on commit 6119aa1

Please sign in to comment.