[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Replacing vendor and customer tables



Hiya;

I'm digging around in the Vendor and Customer tables, per JD's entity modifications, and it looks like both tables are fundamentally identical - The only difference is the customer table has customer.invoice_notes and customer.id.

I'm going to remove both tables and replace it with entity_metadata, fkey'd to both entity and entity_class. Queries that directly read from vendor or customer would be easily modified to, for example:

SELECT * FROM entity_metadata em
JOIN entity e on em.entity_id = e.id
WHERE e.name = ?

to replace the query used to verify a vendor or customer in Add Invoice.

Entity_metadata would have the invoice_notes, but lack the id field.

Thoughts?

Thanks,
Aurynn Shaw

The PostgreSQL Company - Command Prompt, Inc. 1.503.667.4564 ext 103
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

..hidden..