MT ã® permalink ã« entry_id 使ã£ã¦ãã®ã§ entry_basename 使ãããå¤æ´ãã
permalink ã®æå®ã <$MTArchiveDate format=\"%Y/%m/%d\"$>/<$MTEntryID pad=\"1\"$>.html ã¦ãã£ã¦ãã®ãèªå㧠basename æå®ã§ããããã«ããããªã¨æã£ã¦ yyyy/mm/dd/entry_basename.html ã«å¤æ´ããã
ãã§ãä»ã¾ã§ã® permalink ãå¤ãã£ã¡ãã¾ããã¨ãããã¨ã§ entry_id -> entry_basename ã«ãªã script ãããã¦ãã£ãã
ãããã0åãå¿ããã®ã§ç´ãããï¼#vag*na 㧠feed 表示ããã¾ãã£ã¦ãã¾ã£ããããã¾ãã >_<ï¼
use strict; use warnings; my $mt = MT::Schema->connect('dbi:mysql:dbname', 'username', 'p4ssw0rd'); my $entries = $mt->resultset('MtEntry')->search({}, {}); while ( my $entry = $entries->next ) { printf("%s -> %s\n", $entry->entry_basename, $entry->entry_id); $entry->update({ entry_basename => scalar sprintf("%06d", $entry->entry_id) }); } package MT::Schema; use strict; use warnings; use base 'DBIx::Class::Schema::Loader'; __PACKAGE__->loader_options( relationships => 0, options => { AutoCommit => 1 }, debug => 1, components => [], ); 1;
MT ãªãã ãã Data::ObjectDriver 使ãã°ããã¨ãè¨ããã¦ãããããªãã