Skip to Content.
Sympa Menu

comanage-dev - [comanage-dev] Re: COmanage DB fks

Subject: COmanage Developers List

List archive

[comanage-dev] Re: COmanage DB fks


Chronological Thread 
  • From: Mike Manske <>
  • To: Benn Oshrin <>
  • Cc: comanage-dev <>, Warren Anderson <>
  • Subject: [comanage-dev] Re: COmanage DB fks
  • Date: Wed, 19 Feb 2014 16:39:27 -0600

Benn - same thing with after install on new platform.  I just ran the DB script and no fks in MySql.  I used the MySQL Workbench to export the DDL - attached.  


On Tue, Feb 18, 2014 at 5:10 PM, Mike Manske <> wrote:
I plan on doing a re-install tomorrow, with basically the same config.  Let you know what the DB looks like after.


On Tue, Feb 18, 2014 at 4:51 PM, Benn Oshrin <> wrote:
[Adding comanage-dev...]


On 2/17/14 7:13 PM, Mike Manske wrote:
Hi - have the latest installed and running.  In order to understand the
DB (I'm using mysql on deb 7) I inspected it using a couple sql tools.
  I was surprised to see no FKs between any tables.

Interesting... in postgres I definitely see foreign keys:

cotest=> \d cm_names
                                        Table "public.cm_names"
     Column      |            Type             | Modifiers

-----------------+-----------------------------+--------------------------------
-----------------------
 id              | integer                     | not null default nextval('cm_names_id_seq'::regclass)
 honorific       | character varying(32)       |
 given           | character varying(128)      |
 middle          | character varying(128)      |
 family          | character varying(128)      |
 suffix          | character varying(32)       |
 type            | character varying(2)        |
 co_person_id    | integer                     |
 org_identity_id | integer                     |
 created         | timestamp without time zone |
 modified        | timestamp without time zone |
 language        | character varying(16)       |
 primary_name    | boolean                     |
Indexes:
    "cm_names_pkey" PRIMARY KEY, btree (id)
Foreign-key constraints:
    "cm_names_co_person_id_fkey" FOREIGN KEY (co_person_id) REFERENCES cm_co_people(id)
    "cm_names_org_identity_id_fkey" FOREIGN KEY (org_identity_id) REFERENCES cm_org_identities(id)

I don't currently have a working mysql instance. Can anyone else who does confirm if foreign keys are set up?


I know some ORM solutions do not use actual db FKs.  Is this the case
with Cake + MySQL.

Cake doesn't really believe in foreign keys, on the theory that the code will maintain referential integrity. I don't subscribe to that theory, so we use adodb to manage our schema (but cake for operational database abstraction), since adodb can manage foreign keys. (It also makes it easier to create the schema programmatically, rather than by introspection of the database, which is the Cake method.)


One other item - when I run the database script (via sudo) I get the
following error, many many times -

Loading schema from file
/home/mikem/cosrc/comanage-registry/app//Config/Schema/schema.xml...
Strict Error: Only variables should be passed by reference in
[/home/mikem/cosrc/comanage-registry/app/Vendor/adodb/adodb-xmlschema03.inc.php,
line 293]

Yeah. At the moment that's just noise, although we should make an effort to clean that up. It will probably require a patch to adodb, which unfortunately doesn't seem to have been updated since 2012. It does seem development recently sort of restarted on github.

Thanks,

-Benn-



--
Michael A. Manske
Leonard E. Parker Center for Gravitation, Cosmology and Astrophysics
University of Wisconsin - Milwaukee
Physics Building, 486



--
Michael A. Manske
Associate Scientist
Leonard E. Parker Center for Gravitation, Cosmology and Astrophysics
University of Wisconsin - Milwaukee
Physics Building, 486
Phone: 414.335.6366

Attachment: Dump20140219.sql.tar.gz
Description: GNU Zip compressed data




Archive powered by MHonArc 2.6.16.

Top of Page