I'm trying to fix prepare-company-database.sh for postgresql 9.1.
I'm finding a few foreign key violations in Roles.sql, for instance:
ledgersmb_development=# INSERT INTO menu_acl (node_id, acl_type, role_name)
ledgersmb_development-# values (134, 'allow', 'lsmb_bigcocom__backup');
ERROR: insert or update on table "menu_acl" violates foreign key constraint "menu_acl_node_id_fkey"
DETAIL: Key (node_id)=(134) is not present in table "menu_node".
The node_id refers into menu_node(id), and as far as I can see, this is
inserted by the function "menu_insert" in Pg-database.sql (line 3413).
It seems to me that the number, "134" is rather magic, and may depend
heavily upon the order in which the menu items are loaded?
sql/upgrade/svn/3470-asset-menu.sql seems to be where it is loaded.
I'm unclear why/how this would get loaded by prepare-company-database.sh.
==== Testing skaffolding. BELOW is not relevant to question, unless you
want to reproduce the problem.
Awhile ago I wanted to hack on ledgersmb, but wanted to make some unit
tests. I started to build some testing skaffolding using the "can-o-pg"
RoR plugin I built. This is what I'm doing for testing. I'll be
pushing my ./prepare-test-database.sh changes back out once I figure
them all out.
To run it:
git clone git://github.com/credil/ledgersmb-skaffold.git
cd ledgersmb-skaffold
git submodule init
git submodule update
tests/01-prepare/tests.sh
(there is only one test so far. Yes, I imported via git-svn. You could
do an SVN clone to subdir ledgersmb if you preferred)
--
] He who is tired of Weird Al is tired of life! | firewalls [
] Michael Richardson, Sandelman Software Works, Ottawa, ON |net architect[
] ..hidden.. http://www.sandelman.ottawa.on.ca/ |device driver[
Kyoto Plus: watch the video <http://www.youtube.com/watch?v=kzx1ycLXQSE>
then sign the petition.
Attachment:
pgppx00Etqe3L.pgp
Description: PGP signature