comanage-dev - [comanage-dev] Re: COmanage DB fks
Subject: COmanage Developers List
List archive
- From: Benn Oshrin <>
- To: Mike Manske <>
- Cc: comanage-dev <>, Warren Anderson <>
- Subject: [comanage-dev] Re: COmanage DB fks
- Date: Tue, 18 Feb 2014 17:51:20 -0500
[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-
- [comanage-dev] Re: COmanage DB fks, Benn Oshrin, 02/18/2014
- [comanage-dev] Re: COmanage DB fks, Mike Manske, 02/18/2014
- [comanage-dev] Re: COmanage DB fks, Mike Manske, 02/19/2014
- [comanage-dev] Re: COmanage DB fks, Mike Manske, 02/18/2014
Archive powered by MHonArc 2.6.16.