Tadashi Okoshi
slash****@users*****
2006年 3月 28日 (火) 18:15:21 JST
Index: affelio/upgrade.cgi
diff -u affelio/upgrade.cgi:1.6 affelio/upgrade.cgi:1.7
--- affelio/upgrade.cgi:1.6 Wed Mar 22 18:15:27 2006
+++ affelio/upgrade.cgi Tue Mar 28 18:15:21 2006
@@ -69,6 +69,47 @@
};
################################
+ #Create accesslog
+ ################################
+ {
+ my $query = 'SELECT * from AFuser_CORE_accesslog';
+ my $sth;
+ eval{
+ $sth = $af->getDB->prepare($query);
+ $sth->execute;
+ };
+ if($@){
+ print "We confirmed that accesslog table does not exist.<BR>";
+ print "So, We will make it<BR>";
+ my $query = <<EOT;
+CREATE TABLE AFuser_CORE_accesslog(id INTEGER PRIMARY KEY,
+ id2 INTEGER,
+ timestamp BIGINT,
+ nickname TEXT,
+ afid TEXT,
+ type TEXT)
+EOT
+
+ my $sth;
+ eval{
+ $sth = $af->getDB->prepare($query);
+ $sth->execute;
+ };
+ if($@){
+ print 'Error occured in creating the table<BR><BR>' . $@;
+ exit(1);
+ }
+
+ }else{
+ #Application table already exists.
+ #So, do nothing.
+ print 'We confirmed that accesslog table already exists.<BR>';
+ print 'So, We will do nothing.<BR>';
+ }
+ }#block
+
+
+ ################################
#Create application table
################################
{