diff --git a/lib/App/Sqitch/Engine/snowflake.sql b/lib/App/Sqitch/Engine/snowflake.sql index 93b244e2..54d3b13e 100644 --- a/lib/App/Sqitch/Engine/snowflake.sql +++ b/lib/App/Sqitch/Engine/snowflake.sql @@ -1,4 +1,15 @@ -CREATE SCHEMA IF NOT EXISTS ®istry; +-- Create the schema but ignore permission errors +EXECUTE IMMEDIATE $$ +BEGIN + IF (NOT EXISTS(SELECT * FROM information_schema.schemata WHERE schema_name = UPPER('®istry'))) THEN + CREATE SCHEMA identifier('®istry'); + -- COMMENT ON SCHEMA identifier('®istry') 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 ®istry IS 'Sqitch database deployment metadata v1.1.';