Tadashi Okoshi
slash****@users*****
2005年 12月 10日 (土) 05:18:30 JST
Index: affelio/upgrade-10-11.cgi
diff -u affelio/upgrade-10-11.cgi:1.5 affelio/upgrade-10-11.cgi:1.6
--- affelio/upgrade-10-11.cgi:1.5 Sat Dec 10 04:47:17 2005
+++ affelio/upgrade-10-11.cgi Sat Dec 10 05:18:30 2005
@@ -99,8 +99,8 @@
################################
#Add columns to friend tale
################################
- add_column($af, 'AFuser_CORE_friends', 'last_news_in', "INTEGER");
- add_column($af, 'AFuser_CORE_friends', 'last_news_out', "INTEGER");
+ add_column($af, 'AFuser_CORE_friends', 'last_news_in', "INTEGER", 0);
+ add_column($af, 'AFuser_CORE_friends', 'last_news_out', "INTEGER", 0);
print 'OK. Successfuly done.<P><B>Delete this CGI immediately!!</B>';
exit(1);
@@ -113,6 +113,7 @@
my $table = shift;
my $col = shift;
my $type = shift;
+ my $def = shift;
my $query = "SELECT $col from $table";
my $sth;
@@ -122,7 +123,7 @@
};
if($@){
print "We confirmed that table [$table] needs column [$col]<BR>";
- my $query2 = "ALTER TABLE $table ADD COLUMN $col $type";
+ my $query2 = "ALTER TABLE $table ADD COLUMN $col $type DEFAULT $def";
my $sth;
eval{
$af->getDB->do($query2);