<p>In deployment script I have:</p>
<pre><code>CREATE TABLE "saldoanal" (
  "nyear" smallint NOT NULL,
  "nmonth" smallint NOT NULL,
   ...
  CONSTRAINT "saldoanal_kol_sum" CHECK (balance_ingerity_check( .... ))
);
</code></pre>
<p>then after table statements function is created:</p>
<pre><code>CREATE FUNCTION "balance_ingerity_check" (....)
 RETURNS boolean
.....
</code></pre>
<p>And of course trying to deploy schema cause error:</p>
<pre><code>ERROR:  function balance_ingerity_check(tbuhschet, tkol, tmoney, tkol, tmoney) does not exist
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
</code></pre>
<p>full error message:</p>
<pre><code>failed to run SQL in /home/kes/work/projects/safevpn/repo2/share/migrations/PostgreSQL/deploy/76/001-auto.sql: DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator::try {...} (): DBI Exception: DBD::Pg::db do failed: ERROR:  function balance_ingerity_check(tbuhschet, tkol, tmoney, tkol, tmoney) does not exist
HINT:  No function matches the given name and argument types. You might need to add explicit type casts. at inline delegation in DBIx::Class::DeploymentHandler for deploy_method-&gt;deploy (attribute declared in /home/kes/work/projects/safevpn/repo2/local/lib/perl5/DBIx/Class/DeploymentHandler/WithApplicatorDumple.pm at line 51) line 18
 (running line 'CREATE TABLE "saldoanal" ( "nyear" smallint NOT NULL, "nmonth" smallint NOT NULL, "schet" tbuhschet NOT NULL, "analitid1" integer DEFAULT 0 NOT NULL, "analitid2" integer DEFAULT 0 NOT NULL, "koldeb" tkol DEFAULT '0' NOT NULL, "sumdeb" tmoney DEFAULT '0' NOT NULL, "kolkred" tkol DEFAULT '0' NOT NULL, "sumkred" tmoney DEFAULT '0' NOT NULL, PRIMARY KEY ("nyear", "nmonth", "schet", "analitid1", "analitid2"), CONSTRAINT "saldoanal_kol_sum" CHECK (balance_ingerity_check(Schet, KolDeb, SumDeb, KolKred, SumKred)) )') at /home/kes/work/projects/safevpn/repo2/local/lib/perl5/DBIx/Class/DeploymentHandler/DeployMethod/SQL/Translator.pm line 248.
DBIx::Class::Storage::TxnScopeGuard::DESTROY(): A DBIx::Class::Storage::TxnScopeGuard went out of scope without explicit commit or error. Rolling back. at /home/kes/work/projects/safevpn/repo2/local/bin/dbic-migration line 0
DBIx::Class::Storage::TxnScopeGuard::DESTROY(): A DBIx::Class::Storage::TxnScopeGuard went out of scope without explicit commit or error. Rolling back. at /home/kes/work/projects/safevpn/repo2/local/bin/dbic-migration line 0
Makefile:148: recipe for target 'dbdeploy' failed
make: *** [dbdeploy] Error 255
</code></pre>
<p>The independent objects must be created first.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/dbsrgits/sql-translator/issues/108">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AASeAtvS6h1abICaFjlqsb9BuED7SdAZks5uIEvUgaJpZM4VWBY0">mute the thread</a>.<img src="https://github.com/notifications/beacon/AASeAtuck7CrKWx1_AYTq9BISlp5zaahks5uIEvUgaJpZM4VWBY0.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/dbsrgits/sql-translator","title":"dbsrgits/sql-translator","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/dbsrgits/sql-translator"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Dependency tree/Object ordering (#108)"}],"action":{"name":"View Issue","url":"https://github.com/dbsrgits/sql-translator/issues/108"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/dbsrgits/sql-translator/issues/108",
"url": "https://github.com/dbsrgits/sql-translator/issues/108",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Dependency tree/Object ordering (#108)",
"sections": [
{
"text": "",
"activityTitle": "**Eugen Konkov**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@KES777",
"facts": [
{
"name": "Repository: ",
"value": "dbsrgits/sql-translator"
},
{
"name": "Issue #: ",
"value": 108
}
]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"dbsrgits/sql-translator\",\n\"issueId\": 108,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"dbsrgits/sql-translator\",\n\"issueId\": 108\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/dbsrgits/sql-translator/issues/108"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 358094388\n}"
}
],
"themeColor": "26292E"
}
]</script>