Return-Path: Delivered-To: apmail-incubator-general-archive@www.apache.org Received: (qmail 88101 invoked from network); 31 Dec 2004 17:59:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 31 Dec 2004 17:59:41 -0000 Received: (qmail 70692 invoked by uid 500); 31 Dec 2004 17:59:32 -0000 Delivered-To: apmail-incubator-general-archive@incubator.apache.org Received: (qmail 70461 invoked by uid 500); 31 Dec 2004 17:59:30 -0000 Mailing-List: contact general-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: general@incubator.apache.org Delivered-To: mailing list general@incubator.apache.org Received: (qmail 70418 invoked by uid 99); 31 Dec 2004 17:59:29 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: unknown (hermes.apache.org: error in processing during lookup of jta@bristowhill.com) Received: from ms-smtp-01-qfe0.socal.rr.com (HELO ms-smtp-01-eri0.socal.rr.com) (66.75.162.133) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 31 Dec 2004 09:59:26 -0800 Received: from [192.168.15.51] (dt081nd4.san.rr.com [204.210.23.212]) by ms-smtp-01-eri0.socal.rr.com (8.12.10/8.12.7) with ESMTP id iBVHxJkM019653; Fri, 31 Dec 2004 09:59:21 -0800 (PST) Message-ID: <41D59377.6020909@bristowhill.com> Date: Fri, 31 Dec 2004 09:59:19 -0800 From: "Jean T. Anderson" User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040819) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derby PPMC CC: pmc@db.apache.org, general@incubator.apache.org, infrastructure@apache.org, dlr@apache.org Subject: Re: Please remove ALL REFERENCES to nagoya References: In-Reply-To: X-Enigmail-Version: 0.85.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Symantec AntiVirus Scan Engine X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Noel J. Bergman wrote: > <>... > At the moment, I'm the one working on the webapp migrations, and, yes, we > need to get it done pretty soon, but if you have time to take a look and > come up with a better strategy, that's fine with me. I assume the database has to be rebuilt and the ids will change. We could provide mapping tables between old and new ids, which people could use with their favorite tool (perl, awk, python, whatever) to update references in web pages. This would be more accurate (and less frustrating) than trying to manually reset ids. If you already considered this strategy and eliminated it, stop reading now! :-) Otherwise, here are more assumptions .... 1) The index info is stored in a MySQL database. And I'm assuming we can't freely alter those tables to add columns of our own. 2) Looking at the SQL schema, these are the ids that get autogenerated and need to be migrated: eb_list.listId eb_ListFile.fileId eb_Author.authorId eb_Subject.subjectId eb_Thread.threadId eb_Message.msgId The ids that are the most tedious to update and most likely to break web pages are the last three: eb_Subject.subjectId, eb_Thread.threadId, and eb_Message.msgId. For eb_Thread.threadId, I assume the 950240 below corresponds to the threadId: http://nagoya.apache.org/eyebrowse/BrowseList?listName=derby-user@db.apache.org&by=thread&from=950240&to=950240&first=1&count=1 For eb_Subject.subjectId, I assume the 632288 below corresponds to subjectId: http://nagoya.apache.org/eyebrowse/BrowseList?listName=derby-user@db.apache.org&by=subject&from=632288&to=632288&first=1&count=2 For eb_Message.msgId, that table also has a column called msgNo that is not autogenerated by the database. How does it get filled in? And, given the URI below: http://nagoya.apache.org/eyebrowse/ReadMsg?listName=derby-user@db.apache.org&msgNo=446 Does the 446 match eb_Message.msgId or eb_Message.msgNo ? 3) Remapping id's Each table with a changing id would have a corresponding "old" table, such as eb_Message_old, and a "migrate" table, such as eb_Message_mig. The "old" table would match the schema of the production table exactly and would preserve the contents of the table before the database is rebuilt. The migration table would map old and new ids. These are 'pseudo' sql statement because I haven't worked with MySQL (but I'm happy to do so if this interests anyone): CREATE TABLE eb_Message_mig ( msgIdOld INTEGER NOT NULL, msgIdNew INTEGER NOT NULL); initialize mapping table: insert into eb_Message_mig (msgIdOld) select msgId from eb_Message_old Filling in the new ids requires information that is static for both old and new. If the msgNo is taken from the email header, that would be ideal and the mapping table could be updated with a statement something like this: update eb_Message_mig mig set mig.msgIdNew = (select new.msgId from eb_Message new, eb_Message_old old where old.msgId=mig.msgIdOld and new.msgDate = old.msgDate and new.msgNo = old.msgNo ) If msgNo isn't a good candidate then we'd simply need to find a good candidate, perhaps with joins to other tables so we can uniquely identify a record. Given those mapping tables, we could accurately update web pages to reference the new ids. There would be a time lag, of course, during the migration when ids would be broken. But since they'll break anyhow ... :-) What do you think? too tangled? -jean - --------------------------------------------------------------------- To unsubscribe, e-mail: general-unsubscribe@incubator.apache.org For additional commands, e-mail: general-help@incubator.apache.org