[Vtigercrm-developers] Add foreign Key to manifest.xml

kkoci kristian.koci at gmail.com
Wed Jul 23 05:40:05 GMT 2014


I'm sorry if this is a noob or annoying question, but I have so many doubts
so, here it goes...

I have a table called vtiger_accounting, this table has a primary key which
is vtiger_accounting.accountingid

All data already stored in these tables are mapped and showing in my module
(a custom version of accounting module for vtiger 6), but i need to map all
this data from vtiger_accounting to vtiger_accounting_payments

vtiger_accounting_payments has 'transactionid' as the table which stores all
payments for a given accounting register, having one, two or three payments
per accounting register.

Now, I need to know if I can have 'accountingid' as a foreign key for
vtiger_accounting_payments so I can map all data from 'accountingid' to
'transactionid', so i can show all data already stored in this table in my
module fields.

I thought about having a different table, let's say vtiger_accounting_pagos,
and then the same fields from 'accounting_payments' into this new table, but
my problem is that I have to relate every accounting to this new one, (two
or more records per accounting)

I don't know if a correct approach would be declaring this foreign key on
the manifest.xml file of my new accounting module? 

Like:



Should it map all fields automatically? 

OR maybe I should put as a PRIMARY KEY the same 'accountingid' from
vtiger_accounting table, instead of 'idpayment'?

I'm not really sure, any ideas?

Thanks in advance.



--
View this message in context: http://vtiger-crm.2324883.n4.nabble.com/Add-foreign-Key-to-manifest-xml-tp11583.html
Sent from the vtigercrm-developers mailing list archive at Nabble.com.


More information about the vtigercrm-developers mailing list