[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: menu_acl in Roles.sql
- Subject: Re: menu_acl in Roles.sql
- From: Chris Travers <..hidden..>
- Date: Thu, 29 Dec 2011 19:06:57 -0800
On Wed, Dec 28, 2011 at 7:59 PM, Michael Richardson <..hidden..> wrote:
> 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
> (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.
> Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
> infrastructure or vast IT resources to deliver seamless, secure access to
> virtual desktops. With this all-in-one solution, easily deploy virtual
> desktops for less than the cost of PCs and save 60% on VDI infrastructure
> costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
> Ledger-smb-devel mailing list
The nodes referenced there should be inserted in the COPY menu_node
statement in the Pg-database.
If the menu node is truly missing, we should delete the statement. It
could refer to a node that was deleted for one reason or another.