Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency tree/Object ordering #108

Open
KES777 opened this issue Jul 19, 2018 · 1 comment
Open

Dependency tree/Object ordering #108

KES777 opened this issue Jul 19, 2018 · 1 comment

Comments

@KES777
Copy link
Contributor

KES777 commented Jul 19, 2018

In deployment script I have:

CREATE TABLE "saldoanal" (
  "nyear" smallint NOT NULL,
  "nmonth" smallint NOT NULL,
   ...
  CONSTRAINT "saldoanal_kol_sum" CHECK (balance_ingerity_check( .... ))
);

then after table statements function is created:

CREATE FUNCTION "balance_ingerity_check" (....)
 RETURNS boolean
.....

And of course trying to deploy schema cause error:

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.

full error message:

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->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

The independent objects must be created first.

@rabbiveesh
Copy link
Contributor

Hi, is this an issue in SQLT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants