Created
July 20, 2018 16:50
-
-
Save cayetanobv/188ffc21d41fecb1ec5b15bc2c04c56f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
DROP FUNCTION IF EXISTS testing_environments_path(text); | |
CREATE OR REPLACE FUNCTION testing_environments_path( | |
dbschema text | |
) | |
RETURNS void AS | |
$$ | |
BEGIN | |
EXECUTE format('CREATE SCHEMA %I;', dbschema); | |
EXECUTE format('SET LOCAL search_path TO %I,public', dbschema); | |
CREATE TABLE testing_table_to_delete ( | |
id serial PRIMARY KEY, | |
name text | |
); | |
INSERT INTO testing_table_to_delete (name) | |
VALUES | |
('one'), ('two'), ('three'); | |
END; | |
$$ LANGUAGE plpgsql; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment