projects
/
migration-tools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(from parent 1:
5a192db
)
third variant of migration_tools.assert with success message as 3rd argument
author
Jason Etheridge
<jason@esilibrary.com>
Thu, 30 Mar 2017 17:32:44 +0000 (13:32 -0400)
committer
Jason Etheridge
<jason@esilibrary.com>
Thu, 30 Mar 2017 17:32:44 +0000 (13:32 -0400)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
sql/base/base.sql
patch
|
blob
|
history
diff --git
a/sql/base/base.sql
b/sql/base/base.sql
index
7eb55e0
..
82a7e7a
100644
(file)
--- a/
sql/base/base.sql
+++ b/
sql/base/base.sql
@@
-2467,3
+2467,14
@@
CREATE OR REPLACE FUNCTION migration_tools.assert (BOOLEAN,TEXT) RETURNS VOID AS
END;
$$ LANGUAGE PLPGSQL STRICT VOLATILE;
+CREATE OR REPLACE FUNCTION migration_tools.assert (BOOLEAN,TEXT,TEXT) RETURNS TEXT AS $$
+ DECLARE
+ test ALIAS FOR $1;
+ fail_msg ALIAS FOR $2;
+ success_msg ALIAS FOR $3;
+ BEGIN
+ ASSERT test, fail_msg;
+ RETURN success_msg;
+ END;
+$$ LANGUAGE PLPGSQL STRICT VOLATILE;
+