Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
138 lines (98 sloc) 5.02 KB
2005-03-28 Andreas Koenig <andk@cpan.org>
* revision 585 removed references to chapternr and after it was
installed, we removed the column completely. This should now be
the final entry in this memo, because we have the three tables
adjusted to each other:
CREATE TABLE applymod (
[...]
chapterid int(10) unsigned NOT NULL default '0',
PRIMARY KEY (modid)
) TYPE=MyISAM;
CREATE TABLE chapters (
chapterid int(10) unsigned NOT NULL default '0',
[...]
) TYPE=ISAM PACK_KEYS=1;
CREATE TABLE mods (
[...]
chapterid int(10) unsigned NOT NULL default '0',
PRIMARY KEY (modid)
) TYPE=ISAM PACK_KEYS=1;
* we still have the column chapternr in chapters and chapterid
everywhere else. So lets do
alter table chapters add chapterid int(10) unsigned not null after chapternr;
update chapters set chapterid=chapternr;
Then we can remove all references to chapternr;
DONE.
* This is what Tim suggests:
1. Add three new chapters: "Documentation", "Pragma", "Perl6".
2. Move Pod::* and OODoc from Chapter 2 into "Documentation" chapter.
3. Move pragma modules from Chapter 2 into "Pragma" chapter.
4. Move Perl6::* modules from Chapter 2 into "Perl6" chapter.
5. Rename Chapter 2 to "Language Extensions".
Which translates to:
insert into chapters values (26, "Documentation", "Documentation");
insert into chapters values (27, "Pragma", "Pragma");
insert into chapters values (28, "Perl6", "Perl6");
update mods set chapterid=26 where chapterid=2 and modid like 'Pod%' or modid like 'OODoc%';
update mods set chapterid=27 where modid rlike '^(constant|define|diagnostics|enum|integer|less|lib|overload|sigtrap|strict|subs|vars)';
update mods set chapterid=28 where modid like 'Perl6%';
update chapters set longtitle=shorttitle="Language Extensions" where chapternr=2;
and is DONE.
* Yesterday the schema change that shall put an end to confusion:
alter table chapters change chapterid longtitle char(80) not null default "";
Now I must find out how we're going to unify longtitle and
shorttitle, but I can already start reorganizing chapters as Tim
suggested.
2005-03-21 Andreas Koenig <andk@cpan.org>
* The "first round" of changes was done last Monday (2005-03-14)
and the exact commands were:
alter table chapters modify chapternr int(10) unsigned not null default '0';
update chapters set shorttitle=substring(shorttitle,4);
update chapters set chapterid=substring(chapterid,4) where chapterid like '_)%';
update chapters set chapterid=substring(chapterid,5) where chapterid like '__)%';
delete from chapters where chapternr=99;
alter table mods modify chapterid int(10) unsigned not null default '0';
alter table applymod modify chapterid int(10) unsigned not null default '0';
After one week of monitoring PAUSE I'm confident nothing broke.
2004-11-01 Andreas Koenig <andk@cpan.org>
* About to check in rev 519 which should contain code that is able
to survive several alter table commands. The change should not
break anything.
* Once again trying to clean up the chapterid mess.
The database has three tables with a field named chapterid. In
mod.mods and mod.applymod the field is char(2), in mod.chapters it
is char(80). But the field *chapternr* in table mod.chapters is
char(2). Much reason for confusion.
Besides, there is a permanent need to switch back and forth
between integer values and integer values with leading spaces and
integer values with leading underscores (because chtml does not
allow leading blanks). That makes changes regarding the chapter
stuff difficult.
In the first round, I aim at changing the database thusly:
alter table chapters modify chapternr int(10) unsigned not null default '0';
alter table mods modify chapterid int(10) unsigned not null default '0';
alter table applymod modify chapterid int(10) unsigned not null default '0';
The next thing I find annoying is that the field
mod.chapter.shorttitle always redundantly contains the number that
is already in the chapternr field. And I dislike the idea that
"99" stands for Unknown where we could do so well with having ""
stand for unknown. So the next step whould be:
delete from chapters where chapternr=99;
chapters set shorttitle=substring(shorttitle,4);
Before doing any of the above, I try to write the code in a way
that works before and after the change, so its easier to switch
back.
The "99" thing seems low-risk, so I start addressing this
immediately. Everything else is protected by the global variable
$strict_chapterid.
Finally I would like to address the redundant number in the
chapterid field in the chapters table (the one with the char(80)
specification). Maybe something like:
update chapters set chapterid=substring(chapterid,4) where chapterid like '_)%'; update chapters set chapterid=substring(chapterid,5) where chapterid like '__)%';
And the field name should also change. But I do not yet dare to
start working on that.
2004-10-31 Andreas Koenig <andk@cpan.org>
Local Variables:
mode: change-log
change-log-default-name: "memo.chapterid-2004-11.txt"
End: