From shane at ripe.net Wed Oct 26 13:01:40 2005 From: shane at ripe.net (Shane Kerr) Date: Wed, 26 Oct 2005 13:01:40 +0200 Subject: [whoisserver-dev] Re: Technical Question about Whois In-Reply-To: <200510251428.j9PES82F003700@ns1.afrinic.net> References: <200510251428.j9PES82F003700@ns1.afrinic.net> Message-ID: <435F6214.4000705@ripe.net> Frank, [ I've asked Can to add you to the whoisserver-dev list that we've set up to discuss details of Whois software development. I've also Cc'd the list with this reply. ] Frank wrote: >I've got another question for you. How do the organisation tables work? I >notice there are : > >| org | >| org_name | >| organisation | >| organisation_id > >How are these used ? How are the object_ids generated for them and how are >they linked to the other tables? > > The org table is used for the "org:" attribute, which can appear in any object. The organisation and org_name tables are for the respective attributes, which appear in the organisation objects. The organisation_id table is used for the auto-generated "organisation:" attributes. We base the attribute on the first letters of the organisation name, plus a number. So "Shane's ISP" would have "ORG-SI###-RIPE" as the "organisation:" attribute. The number, ###, is determined by looking at the organisation_id table. So the code does something like: SELECT range_end+1 FROM organisation_id WHERE space="SI" AND source="-RIPE"; The source column is the same as the "source:" of the database: RIPE for us, AFRINIC for you. -- Shane