[Affelio-cvs 835] CVS update: affelio

Back to archive index

Tadashi Okoshi slash****@users*****
2005年 12月 10日 (土) 10:01:00 JST


Index: affelio/upgrade-10-11.cgi
diff -u affelio/upgrade-10-11.cgi:1.7 affelio/upgrade-10-11.cgi:1.8
--- affelio/upgrade-10-11.cgi:1.7	Sat Dec 10 08:07:38 2005
+++ affelio/upgrade-10-11.cgi	Sat Dec 10 10:01:00 2005
@@ -139,6 +139,46 @@
     }#block
 
     ################################
+    #Create my_news
+    ################################
+    {
+	my $query = 'SELECT * from AFuser_CORE_my_news';
+        my $sth;
+	eval{
+	    $sth = $af->getDB->prepare($query);
+	    $sth->execute;
+	};
+	if($@){
+	    print "We confirmed that my_news table does not exist.<BR>";
+	    print "So, We will make it<BR>";
+	    my $query = <<EOT;
+CREATE TABLE AFuser_CORE_my_news(nid INTEGER PRIMARY KEY AUTOINCREMENT, 
+				   datetime INTEGER,
+				   app_install_name TEXT,
+				   title TEXT,
+				   description TEXT,
+				   creator TEXT,
+				   URL 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 my_news table already exists.<BR>';
+	    print 'So, We will do nothing.<BR>';
+	}
+    }#block
+
+    ################################
     #Add columns to friend tale
     ################################
     add_column($af, 'AFuser_CORE_friends', 'last_news_in', "INTEGER", 0);


Affelio-cvs メーリングリストの案内
Back to archive index